Test-IdfPowerShell.ps1 988 B

12345678910111213141516171819202122232425262728293031
  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 PowerShell.lnk')
  13. $Command = '. ' + $Shortcut.Arguments -replace '""', '"'
  14. $Command = $Command -replace " -ExecutionPolicy Bypass -NoExit -File", ""
  15. $Command
  16. Invoke-Expression -Command $Command
  17. cd examples\get-started\blink\
  18. idf.py build
  19. # Check whether the repository is clean
  20. $GitChanges=(git status -s).Lenght
  21. if ($GitChanges -gt 0) {
  22. "* Warning! Git repository dirty."
  23. $GitChanges
  24. } else {
  25. "Git repository clean."
  26. }