mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-20 03:48:30 +00:00
Added restriction policy error (#4370)
* Added restriction policy error * Update KnownIssues.md * Update KnownIssues.md * Update KnownIssues.md * Update KnownIssues.md
This commit is contained in:
@@ -22,46 +22,8 @@ If you are still having issues, try using a **VPN**, or changing your **DNS prov
|
|||||||
|
|
||||||
### Script Won't Run
|
### Script Won't Run
|
||||||
|
|
||||||
If your PowerShell session is running in **Constrained Language Mode**, some scripts and commands may fail to execute. To check the current language mode, run:
|
If you run WinUtil and get the error:
|
||||||
```powershell
|
|
||||||
$ExecutionContext.SessionState.LanguageMode
|
|
||||||
```
|
|
||||||
If it returns `ConstrainedLanguage`, you may need to switch to `FullLanguage` mode or run the script in a session with administrative privileges. Be aware that some security policies may enforce Constrained Language Mode, especially in corporate or managed environments.
|
|
||||||
|
|
||||||
**If the download fails**:
|
`"WinUtil is unable to run on your system, powershell execution is restricted by security policies,"`
|
||||||
|
|
||||||
1. Try the direct GitHub link:
|
this means that your PowerShell session is in **Constrained Language Mode**, which prevents WinUtil from running.
|
||||||
|
|
||||||
```powershell
|
|
||||||
irm https://github.com/ChrisTitusTech/Winutil/releases/latest/download/Winutil.ps1 | iex
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Force TLS 1.2:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
||||||
irm "https://christitus.com/win" | iex
|
|
||||||
```
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> On Windows 11, you usually do not need the TLS 1.2 command. Use it only if you encounter download or security protocol errors.
|
|
||||||
|
|
||||||
### Execution Policy Error
|
|
||||||
|
|
||||||
If you see an execution policy error when running the downloaded script, you can allow the current session to run unsigned scripts with this command:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
Set-ExecutionPolicy Unrestricted -Scope Process -Force
|
|
||||||
irm "https://christitus.com/win" | iex
|
|
||||||
```
|
|
||||||
|
|
||||||
This only changes the policy for the current PowerShell process and is safe for one-off runs.
|
|
||||||
|
|
||||||
### Interface Doesn't Appear
|
|
||||||
|
|
||||||
If Winutil downloads, but the GUI does not open or appear, try these steps:
|
|
||||||
|
|
||||||
1. Check if your antivirus or Windows Defender is blocking the script — add an exclusion if necessary.
|
|
||||||
2. Ensure you launched PowerShell / Terminal as **Administrator**.
|
|
||||||
3. Close and reopen PowerShell, then run the launch command again.
|
|
||||||
4. If the script still doesn't show, try running the script in a visible PowerShell window (avoid background/silent shells) to observe output and errors.
|
|
||||||
|
|||||||
@@ -33,6 +33,10 @@ if ($Offline) {
|
|||||||
$PARAM_OFFLINE = $true
|
$PARAM_OFFLINE = $true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($ExecutionContext.SessionState.LanguageMode -ne 'FullLanguage') {
|
||||||
|
Write-Host "WinUtil is unable to run on your system, powershell execution is restricted by security policies" -ForegroundColor Red
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||||
Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
|
Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
|
||||||
|
|||||||
Reference in New Issue
Block a user