From: Ardis Lu Date: Thu, 22 Aug 2024 06:38:48 +0000 (-0700) Subject: Check for PowerShell 7 X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=dd8740eead2bb7169e509e184e666757601e2511;p=ArdisUtilities Check for PowerShell 7 --- diff --git a/install.ps1 b/install.ps1 index e31e807..d55ff51 100644 --- a/install.ps1 +++ b/install.ps1 @@ -48,6 +48,15 @@ function Install-ArdisUtilities { ) begin { + if (($PSVersionTable.PSVersion.Major) -lt 7) { + throw @" +Error: PowerShell 7 or later is required to install ArdisUtilities. +Upgrade PowerShell: + + https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell +"@ + } + # Create a temporary working folder $tempFolder = Join-Path $([IO.Path]::GetTempPath()) $(New-Guid) New-Item -Type Directory -Path $tempFolder | Out-Null