PowerShell's help (powershell -?
) states:
-Version Starts the specified version of Windows PowerShell.
However, when starting PowerShell 2 with powershell -Version 1
all things I tried that are only present in v2 and not v1 still work, such as the -split
operator or the Get-Random
cmdlet.
So what exactly changes when running PowerShell with the -Version
parameter if language features and cmdlets that were introduced later still exist and work? This makes testing scripts for PowerShell v1 a bit harder since I don't always remember what has changed.