PoshCode Archive  Artifact [24efb7ed7a]

Artifact 24efb7ed7a5bb7d77e62ddbfb10dbb5b2b2eb35c0c111a8afbf539d2ce2efd03:

  • File Check-PowerShell-version.ps1 — part of check-in [e8ffec08a6] at 2018-06-10 13:26:12 on branch trunk — Check if PowerShell version 3 or higher is installed (user: Adam Mendoza size: 672)

# encoding: ascii
# api: powershell
# title: Check PowerShell version
# description: Check if PowerShell version 3 or higher is installed
# version: 3.0
# author: Adam Mendoza
# license: CC0
# x-poshcode-id: 3473
# x-archived: 2016-06-19T06:20:17
# x-published: 2013-06-22T14:44:00
#
#

#Check if PowerShell version 3 or higher is installed
if($host.Version.Major -lt 3)
{
 Write-Host "PowerShell Version 3 or higher needs to be installed"  -ForegroundColor Red
 Write-Host "Windows Management Framework 3.0 - RC"  -ForegroundColor Magenta
 Write-Host "http://www.microsoft.com/en-us/download/details.aspx?id=29939"  -ForegroundColor Magenta
 Break
}