Skip to content

Commit

Permalink
Fallback to default path when powershell.exe is not found in PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kozlowski committed Aug 22, 2023
1 parent 9922dc5 commit aa3d3e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion software/script/chameleon_cli_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def on_exec(self, args: argparse.Namespace):
PSHEXE=fn
break
if PSHEXE:
process = subprocess.Popen(["powershell.exe","Get-CimInstance -ClassName Win32_serialport | Where-Object {$_.PNPDeviceID -like '*VID_6868&PID_8686*'} | Select -expandproperty DeviceID"],stdout=subprocess.PIPE);
process = subprocess.Popen([PSHEXE,"Get-CimInstance -ClassName Win32_serialport | Where-Object {$_.PNPDeviceID -like '*VID_6868&PID_8686*'} | Select -expandproperty DeviceID"],stdout=subprocess.PIPE);
res = process.communicate()[0]
_comport = res.decode('utf-8').strip()
if _comport:
Expand Down

0 comments on commit aa3d3e4

Please sign in to comment.