for /scan you remove the /
$ActionVar = "/scan -report=$LogPath"
$Action = $ActionVar -replace "/",""
out: $Action = "scan -report=$LogPath"
in line 554, you use $Action expecting it to be "scan", but as it is "scan -report=$LogPath" the whole command is buggy as it has two -report parameters now (one of which is also completely wrong)
C:\Users\Dell\CMSL\Logs> invoke-dcu -Verbose VERBOSE: /scan -report=C:\Users\Dell\CMSL\Logs -outputlog="C:\Users\Dell\CMSL\Logs\DCU-CLI-20241104-163102-scan -report=C:\Users\Dell\CMSL\Logs.log"
possible solution:
548-551
if ($scan){$ActionVar = "/scan -report=$LogPath";$Action="Scan"}
if ($applyUpdates){$ActionVar = "/applyUpdates";$Action="ApplyUpdates"}
else {$ActionVar = "/scan -report=$LogPath";$Action="Scan"}
#$Action = $ActionVar -replace "/",""
https://github.com/gwblok/garytown/blob/6193d19767316f1f7a7210a284c70a2538e4405a/hardware/Dell/CommandUpdate/CMSL/Dell-CMSL.ps1#L551
for /scan you remove the / $ActionVar = "/scan -report=$LogPath" $Action = $ActionVar -replace "/","" out: $Action = "scan -report=$LogPath"
in line 554, you use $Action expecting it to be "scan", but as it is "scan -report=$LogPath" the whole command is buggy as it has two -report parameters now (one of which is also completely wrong)
C:\Users\Dell\CMSL\Logs> invoke-dcu -Verbose VERBOSE: /scan -report=C:\Users\Dell\CMSL\Logs -outputlog="C:\Users\Dell\CMSL\Logs\DCU-CLI-20241104-163102-scan -report=C:\Users\Dell\CMSL\Logs.log"
possible solution: 548-551