Test-Idf.ps1 1.6 KB

12345678910111213141516171819202122232425262728
  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. #.\export.ps1
  8. $env:PYTHONPATH="C:\Users\ContainerAdministrator\Desktop\esp-idf\tools\"
  9. # Append build script and launch via link
  10. #Add-Content -Path ${IdfPath}\export.bat -Value ${BuildCommands}
  11. # timeout is necessary to fix the problem when installer is writing some final files
  12. # it seems that installer exits, but locks were not released yet
  13. Start-Sleep -s 5
  14. $WSShell = New-Object -comObject WScript.Shell
  15. $Shortcut = $WSShell.CreateShortcut('C:\Users\ContainerAdministrator\Desktop\ESP-IDF Command Prompt (cmd.exe).lnk')
  16. $Arguments = $Shortcut.Arguments -replace "/k ", "/c '"
  17. $Command = $Shortcut.TargetPath + ' ' + $Arguments -replace '""', '"'
  18. $Command += " && cd examples\get-started\blink\ && idf.py build'"
  19. Invoke-Expression -Command $Command
  20. #powershell.exe
  21. #C:\Windows\system32\cmd.exe /c '"C:\Users\ContainerAdministrator\.espressif\idf_cmd_init.bat" "C:\Users\ContainerAdministrator\.espressif\python_env\idf4.1_py3.7_env\Scripts" "C:\Program Files\Git\cmd\" && cd examples\get-started\blink\ && idf.py build'
  22. #cmd /c "ping -n 4 127.0.0.1 && .\export.bat && cd examples\get-started\blink\ && idf.py build"
  23. #cmd /c "ping -n 4 127.0.0.1 && .\export.bat && cd examples\get-started\blink\ && idf.py build"
  24. #cmd /c "timeout 4 && C:\Users\ContainerAdministrator\.espressif\idf_cmd_init.bat 'C:\' && cd examples\get-started\blink\ && idf.py build"
  25. #& "C:\Users\ContainerAdministrator\Desktop\esp-idf\Run ESP-IDF Command Prompt (cmd.exe).lnk"