First, the correct method of checking your PowerShell version is to check the variable $PSVersionTable.PSVersion
and not use $Host or Get-Host.
Second, you should do some research about what version of PowerShell you should install on your server instead of just updating it to the latest version available. A great post by The Scripting Guy Should I Upgrade to Latest Windows PowerShell Version? can help you make this decision. For example, the post points out that upgrading PowerShell can break important applications:
Will upgrading Windows PowerShell break any of my applications?
Unfortunately the answer is that it might. The Release Notes for
Windows PowerShell 4.0 supply the following list of applications with
which Windows PowerShell 4.0 is incompatible:
- System Center 2012 Configuration Manager (not including SP1)
- System Center Virtual Machine Manager 2008 R2 (including SP1)
- Microsoft Exchange Server 2013, Microsoft Exchange Server 2010, and Microsoft Exchange Server 2007
- Microsoft SharePoint 2013 and Microsoft SharePoint 2010
- Windows Small Business Server 2011 Standard
If your machine is running any of these products, do not install
Windows PowerShell 4.0. Windows PowerShell 3.0 has a very similar
list. Some of these applications (such as Exchange Server 2013) are
made compatible with a service pack. You will need to determine if a
service pack or another fix is available for your particular
application and situation.
Further, new versions of PowerShell and can also break your existing scripts.