Test-IdfCmd.ps1 813 B

12345678910111213141516171819
  1. param (
  2. [string]$PythonPath = "C:\Python38\",
  3. [string]$IdfPath = "C:\Users\ContainerAdministrator\Desktop\esp-idf"
  4. )
  5. $env:PATH+=";${PythonPath}"
  6. Set-Location "${IdfPath}"
  7. $env:PYTHONPATH="C:\Users\ContainerAdministrator\Desktop\esp-idf\tools\"
  8. # Timeout is necessary to fix the problem when installer is writing some final files
  9. # it seems that installer exits, but locks were not released yet
  10. Start-Sleep -s 5
  11. $WSShell = New-Object -comObject WScript.Shell
  12. $Shortcut = $WSShell.CreateShortcut('C:\Users\ContainerAdministrator\Desktop\ESP-IDF Command Prompt (cmd.exe).lnk')
  13. $Arguments = $Shortcut.Arguments -replace "/k ", "/c '"
  14. $Command = $Shortcut.TargetPath + ' ' + $Arguments -replace '""', '"'
  15. $Command += " && cd examples\get-started\blink\ && idf.py build'"
  16. Invoke-Expression -Command $Command