Habilitar Execução de Scripts: valor do Registro EnableScripts e mais 1ComputadorHKLM\Software\Policies\Microsoft\Windows\PowerShell
- ID da política
- EnableScripts
- Escopo
- Configuração do Computador, Configuração do Usuário
- Compatível com
- Pelo menos o Microsoft Windows 7 ou a família Windows Server 2008
- Fonte
- Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (versão 1.0)
- Categoria
- Componentes do Windows › Windows PowerShell
Registro
EnableScripts
REG_DWORDComputadorUsuário…\Software\Policies\Microsoft\Windows\PowerShellHKLM\Software\Policies\Microsoft\Windows\PowerShell Chave atual
HKCU\Software\Policies\Microsoft\Windows\PowerShell
HKCU\Software\Policies\Microsoft\Windows\PowerShell
- Valor habilitado
- 1
- Valor desabilitado
- 0
Aplicar com .reg · CMD · PowerShell
ComputadorConfiguração global do computador
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\PowerShell] ; Opções (use apenas uma) ; Habilitada "EnableScripts"=dword:00000001 ; Desabilitada "EnableScripts"=dword:00000000
CMD
:: Opções (use apenas uma) :: Habilitada reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f :: Desabilitada reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Comum: criar a chave New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null # Opções (use apenas uma) # Habilitada New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null # Desabilitada New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null
UsuárioConfiguração por conta
.reg
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\PowerShell] ; Opções (use apenas uma) ; Habilitada "EnableScripts"=dword:00000001 ; Desabilitada "EnableScripts"=dword:00000000
CMD
:: Opções (use apenas uma) :: Habilitada reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f :: Desabilitada reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Comum: criar a chave New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null # Opções (use apenas uma) # Habilitada New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null # Desabilitada New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null
ExecutionPolicy
REG_SZComputadorUsuário…\Software\Policies\Microsoft\Windows\PowerShellHKLM\Software\Policies\Microsoft\Windows\PowerShell Chave atual
HKCU\Software\Policies\Microsoft\Windows\PowerShell
HKCU\Software\Policies\Microsoft\Windows\PowerShell
- Valor habilitado
- Depende do valor da opção
- Elemento
- Política de execução
| Item | Valor armazenado |
|---|---|
| Permitir apenas scripts assinados | AllSigned |
| Permitir scripts locais e scripts remotos assinados | RemoteSigned |
| Permitir todos os scripts | Unrestricted |
Aplicar com .reg · CMD · PowerShell
ComputadorConfiguração global do computador
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\PowerShell] ; Opções (use apenas uma) ; Permitir apenas scripts assinados "ExecutionPolicy"="AllSigned" ; Permitir scripts locais e scripts remotos assinados "ExecutionPolicy"="RemoteSigned" ; Permitir todos os scripts "ExecutionPolicy"="Unrestricted"
CMD
:: Opções (use apenas uma) :: Permitir apenas scripts assinados reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f :: Permitir scripts locais e scripts remotos assinados reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f :: Permitir todos os scripts reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Comum: criar a chave New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null # Opções (use apenas uma) # Permitir apenas scripts assinados New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null # Permitir scripts locais e scripts remotos assinados New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null # Permitir todos os scripts New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null
UsuárioConfiguração por conta
.reg
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\PowerShell] ; Opções (use apenas uma) ; Permitir apenas scripts assinados "ExecutionPolicy"="AllSigned" ; Permitir scripts locais e scripts remotos assinados "ExecutionPolicy"="RemoteSigned" ; Permitir todos os scripts "ExecutionPolicy"="Unrestricted"
CMD
:: Opções (use apenas uma) :: Permitir apenas scripts assinados reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f :: Permitir scripts locais e scripts remotos assinados reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f :: Permitir todos os scripts reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Comum: criar a chave New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null # Opções (use apenas uma) # Permitir apenas scripts assinados New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null # Permitir scripts locais e scripts remotos assinados New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null # Permitir todos os scripts New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null