diff --git a/Extract-NTHashes.ps1 b/Extract-NTHashes.ps1 index aebbce6..edf67a8 100644 --- a/Extract-NTHashes.ps1 +++ b/Extract-NTHashes.ps1 @@ -25,7 +25,9 @@ Set-StrictMode -Version Latest [string]$commonHelper = Join-Path -Path $PSScriptRoot -ChildPath 'Elysium.Common.ps1' if (-not (Test-Path -LiteralPath $commonHelper)) { throw "Common helper not found at $commonHelper" } . $commonHelper -Restart-WithWindowsPowerShellIfAvailable -BoundParameters $PSBoundParameters -UnboundArguments $MyInvocation.UnboundArguments +if ($PSVersionTable.PSEdition -ne 'Desktop') { + Restart-WithWindowsPowerShellIfAvailable -BoundParameters $PSBoundParameters -UnboundArguments $MyInvocation.UnboundArguments +} $scriptRoot = $PSScriptRoot diff --git a/Test-WeakADPasswords.ps1 b/Test-WeakADPasswords.ps1 index 69951c7..0ed0d3e 100644 --- a/Test-WeakADPasswords.ps1 +++ b/Test-WeakADPasswords.ps1 @@ -27,7 +27,9 @@ Set-StrictMode -Version Latest [string]$commonHelper = Join-Path -Path $PSScriptRoot -ChildPath 'Elysium.Common.ps1' if (-not (Test-Path -LiteralPath $commonHelper)) { throw "Common helper not found at $commonHelper" } . $commonHelper -Restart-WithWindowsPowerShellIfAvailable -BoundParameters $PSBoundParameters -UnboundArguments $MyInvocation.UnboundArguments +if ($PSVersionTable.PSEdition -ne 'Desktop') { + Restart-WithWindowsPowerShellIfAvailable -BoundParameters $PSBoundParameters -UnboundArguments $MyInvocation.UnboundArguments +} $VerbosePreference = "SilentlyContinue"