From aa3d3e40b477e98ef70a1b7610aea749c7b07af1 Mon Sep 17 00:00:00 2001 From: mkozlowski <10508687+m-kozlowski@users.noreply.github.com> Date: Tue, 22 Aug 2023 11:23:50 +0200 Subject: [PATCH] Fallback to default path when powershell.exe is not found in PATH --- software/script/chameleon_cli_unit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/script/chameleon_cli_unit.py b/software/script/chameleon_cli_unit.py index 7e51cd7..f3da704 100644 --- a/software/script/chameleon_cli_unit.py +++ b/software/script/chameleon_cli_unit.py @@ -198,7 +198,7 @@ class HWConnect(BaseCLIUnit): 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: