I can silently uninstall application which doesn't have password Protected using Powershell .
Start-Process -Wait -FilePath $uninstall32 /SILENT
For password protected application (Setup created using Inno SetUp ) it popup for asking password. Is there an option to pass password without popup?
If it succeeds I want to remotely uninstall password protected application
Without password protected application remotely I had uninstalled silently.
I tried
Start-Process -Wait -FilePath $uninstall32 UNINSTALL_PASSWORD =AR /SILENT
tl;dr
Specify the pass-through arguments as a single string:
If you need to embed variable references or expressions in the arguments string, use
"..."quoting, i.e. an expandable (double-quoted) string , rather than'...', a verbatim (single-quoted) string .When you use
Start-Process, any arguments to be passed to the target executable (-FilePath) must be specified via the-ArgumentList(-Args) parameter, to which you must pass a single value.-ArgumentListtechnically accepts an array of string values,[1] allowing you to specify the pass-through arguments individually, separated with,a long-standing bug unfortunately makes it better to encode all arguments in a single string, because it makes the situational need for embedded double-quoting explicit - see this answer.Both parameters can be bound positionally, meaning that values need not be prefixed with the target parameter names.
Therefore, your attempt:
is equivalent to:
and also equivalent to, using positional parameter binding for both
-FilePathand-ArgumentList:That is,
UNINSTALL_PASSWORDalone was bound to-ArgumentList, whereas=ARand/SILENTare additional, positional arguments that cause a syntax error, because both parameters that support positional binding --FilePathand-ArgumentList- are already bound.[1] From PowerShell's perspective, even an array of values (
,-separated values) is a single argument.