I'm attempting to script an v7.9>v8.1 upgrade process (and rollback scenario) across multiple gateways, and wish to kick off the script from my workstation. I can perform remote unattended un/reinstall of 7.9 via powershell Invoke-Command (and Enter-PSSession) just fine, but can't get 8.1.25 install to work.
Either I'm pretty dense (very possible), or it's not as straightforward as running the same command that works locally (like it is for 7.9).
This is a bit bizarre (to me anyway).
I thought it was stumbling on --%
, but uninstall appears to work fine with that argument. I haven't wrapped my head around how it works in CMD vs PowerShell, nor the proper way to parse/escape a quoted argument for cmd.exe /c
(despite stackoverflowing for a while - tried cmd.exe /s /c
as well)
Now I'm thinking it's stumbling because it can't display the Ignition splash screen?
$computerNames =
'IgnitionTest'
$sb = {
"Installing 7.9.16"
cmd.exe /c "C:\Program Files\Inductive Automation\Ignition-7.9.16-windows-x64-installer.exe" --mode unattended --unattendedmodeui none # works fine locally and remotely
pause
"Uninstalling 7.9.16"
cmd.exe /c "C:\Program Files\Inductive Automation\Ignition\uninstall.exe" --mode unattended --unattendedmodeui none # works fine locally and remotely
pause
"Installing 8.1.25 via cmd"
cmd.exe /c "C:\Program Files\Inductive Automation\ignition-8.1.25-windows-64-installer.exe" "--%" "unattended=none" # works locally but interactive???, not remotely
pause
"Uninstalling 8.1.25 via cmd"
cmd.exe /c "C:\Program Files\Inductive Automation\Ignition\uninstall.exe" "--%" "unattended=none" # works fine locally and remotely
pause
"Installing 8.1.25 via ps"
& "C:\Program Files\Inductive Automation\ignition-8.1.25-windows-64-installer.exe" --% "unattended=none" # works locally, not remotely
pause
"Uninstalling 8.1.25 via ps"
& "C:\Program Files\Inductive Automation\ignition\uninstall.exe" --% "unattended=none" # works fine locally and remotely
pause
}
invoke-command -computername $computerNames -scriptblock $sb
# pause
I'd prefer the cmd /c
method, because it waits to return until done, but I imagine there's a way I can do the same thing with the native PS call.