]> git.ardis.lu - ArdisUtilities/commitdiff
Check for PowerShell 7
authorArdis Lu <ardisglu@gmail.com>
Thu, 22 Aug 2024 06:38:48 +0000 (23:38 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 22 Aug 2024 06:38:48 +0000 (23:38 -0700)
install.ps1

index e31e8079c56a795c927f8191c3afee72f70a2c2d..d55ff51b4a0ef3bd7d452e3facc11e9ceb3318e8 100644 (file)
@@ -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
This page took 0.038992 seconds and 4 git commands to generate.