From ec27206453b866b535433f7da4a6f0e24a1cac3e Mon Sep 17 00:00:00 2001 From: Tomas Kracmar Date: Fri, 7 Nov 2025 20:38:26 +0100 Subject: [PATCH] PS7 fixes --- Extract-NTHashes.ps1 | 4 +++- Test-WeakADPasswords.ps1 | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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"