Get-PowerShellVersion.ps1
function Get-PowerShellVersion { [alias('version')] <# .SYNOPSIS Focalized call of PSVersionTable.PSVersion, either full table or cat string .DESCRIPTION By default returns entire PSVersionTable.PSVersion table. Enable -Terse to return simple string only (5.1.15063.1805) .EXAMPLE Get-PowerShellVersion Get-PowerShellVersion -Terse #> Param ( [Switch]$Terse=$False ) if ($Terse){ $ver = '' foreach ($i in $PSVersionTable.PSVersion) {$ver += $i} return "$ver" } else { return $PSVersionTable.PSVersion } } |