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