my end game is to wrap this in invoke-command, to feed a list of PCs, and run the exe on all of them. for now, i’m just trying to run an exe with parameters from powershell. I can run it from a command line and from a scheduled task. but not from powershell. the argument list has a bunch of quotes and backslashes in it.
the following works from a command prompt:
c:\scripts>ARMACleanup.exe /S /V"UI=“Silent” /l*v “c:\Windows\logs\ARMACleanup.LOG”"
the scheduled task “start a program” c:\scripts\armacleanup.exe with arguments:
/S /V"UI=“Auto” /l*v “c:\Windows\logs\ARMACleanup.LOG”"
but I can’t get it to run in powershell. I have tried saving the argument string as a variable and then various ways of running the exe with the variable.
$silent = ‘/S /V"UI=“Auto” /l*v “c:\Windows\logs\ARMACleanup.LOG”"’ #wrapping it in single quotes
& armacleanup.exe $silent
or not setting the location and
& c:\scripts\armacleanup.exe $silent
i get no errors, but nothing happens. the log file doesn’t appear in c:\windows\logs, and the software that armacleanup.exe is supposed to uninstall remains uninstalled.