From 48a92fedf781adebf7b95d9e1335e989be48a788 Mon Sep 17 00:00:00 2001 From: Couleur <82747632+couleurm@users.noreply.github.com> Date: Thu, 15 Sep 2022 17:47:22 +0200 Subject: [PATCH] Add a check for $isLinux (#133) This is a very simple if statement, I don't think there's much to explain ```PowerShell if ($IsLinux){ # PowerShell on Linux has that read-only bool variable set to $true Write-Host "This utility is exclusively designed for Windows" return } ``` --- winutil-test.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/winutil-test.ps1 b/winutil-test.ps1 index a8f5209c..63c64483 100644 --- a/winutil-test.ps1 +++ b/winutil-test.ps1 @@ -5,6 +5,11 @@ Version 0.0.1 #> +if ($IsLinux){ # PowerShell on Linux has that read-only bool variable set to $true + Write-Host "This utility is exclusively designed for Windows" + return +} + #region Variables $global:sync = [Hashtable]::Synchronized(@{}) @@ -1321,4 +1326,4 @@ If($env:args){ } # Create Form -$global:sync["Form"].ShowDialog() | out-null \ No newline at end of file +$global:sync["Form"].ShowDialog() | out-null