Author Posts

August 2, 2018 at 5:10 pm

Is there a way to upgrade powershell version from4.X to 5.1 remotely? I have 300+ servers that needs to be upgraded.

August 2, 2018 at 8:01 pm

Remote is a bit tricky.

See here for the MSI installer for the appropriate OS.

With that, you should be able to do a silent install. Do note that it will not complete until a reboot; the day you do this, you may want to schedule a late-night restart domain-wide or something of that nature.

$Computers = Get-Content -Path '.\ServerList.txt'
$MsiLocation = '\\server\share\WMF5.1.msi'
Invoke-Command -ComputerName $Computers -ScriptBlock {
    Start-Process -NoNewWindow -FilePath 'msiexec.exe' -ArgumentList ('/a "{0}"' -f $MsiLocation), '/qn', '/norestart'

Feel free to use the '/forcerestart' switch if you don't mind taking those servers down for 10-15mins following the installation to get the new version of PS sorted out.

You could do a batch job like this early morning or something and have it all ready by the time everyone gets to work in the morning.

August 2, 2018 at 9:14 pm

This is OK for client systems, but be sure to read the docs for version impacts on say Exchange, System Center, etc.. versions. For example...

August 7, 2018 at 5:11 pm

Thank you would try and update you