diff --git a/thor-seed/thor-seed.ps1 b/thor-seed/thor-seed.ps1 index d333e38..61b39a4 100644 --- a/thor-seed/thor-seed.ps1 +++ b/thor-seed/thor-seed.ps1 @@ -196,6 +196,29 @@ param $ProxyCredentials = [System.Management.Automation.PSCredential]::Empty ) +# THOR Seed requires FullLanguage mode because it uses .NET APIs for TLS, +# download handling, ZIP extraction, and process setup. +$LanguageMode = $ExecutionContext.SessionState.LanguageMode.ToString() +if ($LanguageMode -ne "FullLanguage") +{ + Write-Host "" + Write-Host "===========================================================" -ForegroundColor Red + Write-Host " ERROR: Unsupported PowerShell Language Mode detected" -ForegroundColor Red + Write-Host "===========================================================" -ForegroundColor Red + Write-Host "" + Write-Host "Current Language Mode : $LanguageMode" + Write-Host "" + Write-Host "THOR Seed requires FullLanguage mode and cannot continue." + Write-Host "This is commonly caused by App Control for Business / WDAC," + Write-Host "AppLocker, JEA, or endpoint security policy restrictions." + Write-Host "" + Write-Host "Allow or sign thor-seed.ps1 according to your policy and rerun it." + Write-Host "Reference: https://learn.microsoft.com/en-us/windows/security/application-security/application-control/app-control-for-business/design/script-enforcement" + Write-Host "" + + exit 7 +} + # ##################################################################### # Presets ------------------------------------------------------------- # #####################################################################