Every new version of PowerShell brings new commands. To see what version you have, check $PSVersionTable
:
$PSVersionTable.PSVersion
As of August 2014, PowerShell 4.0 is the latest version and is included by default on Windows 8.1 and Server 2012 R2. It can be installed on Windows 7 and above. See How to Install Windows PowerShell 4.o for more information.
When you writing scripts, if you want to check what versions of PowerShell they’ll need on other systems, check the versions of PowerShell required for the commands. This information is usually available on the command’s TechNet page, which you can find easily by using Get-Command
:
Get-Command Get-NetAdapter | Select HelpUri
Keep in mind that some commands, like the Get-NetAdapter
command, rely on certain versions of Windows, not just the version of PowerShell.
UPDATE: Alexandr pointed out in the comments that this also works (and is much easier to remember)
$host.Version
Another way is $host.version I think it is more easy for remember.=)
That’s definitely easier to remember! I’ve added it to the post.