1 #!/usr/bin/env pwsh 2 $IDF_PATH = $PSScriptRoot 3 4 if($args.count -eq 0){ 5 $TARGETS = "all" 6 }else 7 { 8 $TARGETS = $args[0] -join ',' 9 } 10 Write-Output "Installing ESP-IDF tools" 11 Start-Process -Wait -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install --targets=${TARGETS}" 12 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # if error 13 14 Write-Output "Setting up Python environment" 15 Start-Process -Wait -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install-python-env" 16 if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE} # if error 17 18 19 Write-Output " 20 All done! You can now run: 21 export.ps1 22 " 23