Turn on Script Execution: wartość rejestru EnableScripts i 1 więcejUżytkownikHKCU\Software\Policies\Microsoft\Windows\PowerShell

Brak oficjalnego tekstu w tym języku (wyświetlono oryginał angielski)

Identyfikator zasady
EnableScripts
Zakres
Konfiguracja komputera, Konfiguracja użytkownika
Obsługiwane w systemach
At least Microsoft Windows 7 or Windows Server 2008 family
Źródło
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (wersja 1.0)
Kategoria
Składniki systemu Windows › Windows PowerShell

Rejestr

EnableScripts

REG_DWORDUżytkownikKomputer
Wartość włączona
1
Wartość wyłączona
0
Zastosuj przez .reg · CMD · PowerShell
UżytkownikUstawienie dla każdego konta
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\PowerShell]

; Opcje (użyj tylko jednej)
; Włączone
"EnableScripts"=dword:00000001
; Wyłączone
"EnableScripts"=dword:00000000
CMD
:: Opcje (użyj tylko jednej)

:: Włączone
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Wyłączone
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Wspólne: utwórz klucz
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opcje (użyj tylko jednej)
# Włączone
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Wyłączone
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null
KomputerUstawienie dla całego komputera
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\PowerShell]

; Opcje (użyj tylko jednej)
; Włączone
"EnableScripts"=dword:00000001
; Wyłączone
"EnableScripts"=dword:00000000
CMD
:: Opcje (użyj tylko jednej)

:: Włączone
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Wyłączone
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Wspólne: utwórz klucz
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opcje (użyj tylko jednej)
# Włączone
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Wyłączone
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null

ExecutionPolicy

REG_SZUżytkownikKomputer
Wartość włączona
Zależy od wartości opcji
Element
Execution Policy
Opcje
PozycjaZapisana wartość
Allow only signed scriptsAllSigned
Allow local scripts and remote signed scriptsRemoteSigned
Allow all scriptsUnrestricted
Zastosuj przez .reg · CMD · PowerShell
UżytkownikUstawienie dla każdego konta
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\PowerShell]

; Opcje (użyj tylko jednej)
; Allow only signed scripts
"ExecutionPolicy"="AllSigned"
; Allow local scripts and remote signed scripts
"ExecutionPolicy"="RemoteSigned"
; Allow all scripts
"ExecutionPolicy"="Unrestricted"
CMD
:: Opcje (użyj tylko jednej)

:: Allow only signed scripts
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Allow local scripts and remote signed scripts
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Allow all scripts
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Wspólne: utwórz klucz
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opcje (użyj tylko jednej)
# Allow only signed scripts
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Allow local scripts and remote signed scripts
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Allow all scripts
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null
KomputerUstawienie dla całego komputera
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\PowerShell]

; Opcje (użyj tylko jednej)
; Allow only signed scripts
"ExecutionPolicy"="AllSigned"
; Allow local scripts and remote signed scripts
"ExecutionPolicy"="RemoteSigned"
; Allow all scripts
"ExecutionPolicy"="Unrestricted"
CMD
:: Opcje (użyj tylko jednej)

:: Allow only signed scripts
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Allow local scripts and remote signed scripts
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Allow all scripts
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Wspólne: utwórz klucz
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Opcje (użyj tylko jednej)
# Allow only signed scripts
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Allow local scripts and remote signed scripts
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Allow all scripts
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null