Turn on Script Execution: wartość rejestru EnableScripts i 1 więcejKomputerHKLM\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_DWORDKomputerUżytkownik…\Software\Policies\Microsoft\Windows\PowerShellHKLM\Software\Policies\Microsoft\Windows\PowerShell Bieżący klucz
HKCU\Software\Policies\Microsoft\Windows\PowerShell
HKCU\Software\Policies\Microsoft\Windows\PowerShell
- Wartość włączona
- 1
- Wartość wyłączona
- 0
Zastosuj przez .reg · CMD · PowerShell
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
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
ExecutionPolicy
REG_SZKomputerUżytkownik…\Software\Policies\Microsoft\Windows\PowerShellHKLM\Software\Policies\Microsoft\Windows\PowerShell Bieżący klucz
HKCU\Software\Policies\Microsoft\Windows\PowerShell
HKCU\Software\Policies\Microsoft\Windows\PowerShell
- Wartość włączona
- Zależy od wartości opcji
- Element
- Execution Policy
| Pozycja | Zapisana wartość |
|---|---|
| Allow only signed scripts | AllSigned |
| Allow local scripts and remote signed scripts | RemoteSigned |
| Allow all scripts | Unrestricted |
Zastosuj przez .reg · CMD · PowerShell
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
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