Menu

[ea00bd]: / ps-versions / versionChecks.PS1  Maximize  Restore  History

Download this file

20 lines (16 with data), 378 Bytes

#Requires -Version 3.0
Write-Output "I'm version 3.0 or above:"
$PSVersionTable

# There are other options such as manually checking the
# version of PowerShell and performing other actions such
# as inspecting the major version, e.g.

if ($PSVersionTable.PSVersion.Major -gt 2)
{
   Write-Output "Yay"
}
else
{
   Write-Output "Boo"
}

# breaks version down
(Get-Host).version
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.