Activer l’exécution des scripts : valeur de Registre EnableScripts et 1 autresUtilisateurHKCU\Software\Policies\Microsoft\Windows\PowerShell

ID de stratégie
EnableScripts
Étendue
Configuration ordinateur, configuration utilisateur
Pris en charge sur
Au moins Microsoft Windows 7 ou famille Windows Server 2008
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Catégorie
Composants Windows › Windows PowerShell

Registre

EnableScripts

REG_DWORDUtilisateurOrdinateur
Valeur si activée
1
Valeur si désactivée
0
Appliquer avec .reg · CMD · PowerShell
UtilisateurParamètre par compte
.reg
Windows Registry Editor Version 5.00

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

; Options (en utiliser une seule)
; Activé
"EnableScripts"=dword:00000001
; Désactivé
"EnableScripts"=dword:00000000
CMD
:: Options (en utiliser une seule)

:: Activé
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Désactivé
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Commun : créer la clé
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Options (en utiliser une seule)
# Activé
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Désactivé
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null
OrdinateurParamètre valable pour tout l’ordinateur
.reg
Windows Registry Editor Version 5.00

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

; Options (en utiliser une seule)
; Activé
"EnableScripts"=dword:00000001
; Désactivé
"EnableScripts"=dword:00000000
CMD
:: Options (en utiliser une seule)

:: Activé
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 1 /f
:: Désactivé
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "EnableScripts" /t REG_DWORD /d 0 /f
PowerShell
# Commun : créer la clé
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Options (en utiliser une seule)
# Activé
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 1 -Force | Out-Null
# Désactivé
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'EnableScripts' -PropertyType DWord -Value 0 -Force | Out-Null

ExecutionPolicy

REG_SZUtilisateurOrdinateur
Valeur si activée
Dépend de la valeur de l'option
Élément
Stratégie d’exécution
Options
EntréeValeur stockée
Autoriser uniquement les scripts signésAllSigned
Autoriser les scripts locaux et les scripts signés distantsRemoteSigned
Autoriser tous les scriptsUnrestricted
Appliquer avec .reg · CMD · PowerShell
UtilisateurParamètre par compte
.reg
Windows Registry Editor Version 5.00

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

; Options (en utiliser une seule)
; Autoriser uniquement les scripts signés
"ExecutionPolicy"="AllSigned"
; Autoriser les scripts locaux et les scripts signés distants
"ExecutionPolicy"="RemoteSigned"
; Autoriser tous les scripts
"ExecutionPolicy"="Unrestricted"
CMD
:: Options (en utiliser une seule)

:: Autoriser uniquement les scripts signés
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Autoriser les scripts locaux et les scripts signés distants
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Autoriser tous les scripts
reg add "HKCU\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Commun : créer la clé
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Options (en utiliser une seule)
# Autoriser uniquement les scripts signés
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Autoriser les scripts locaux et les scripts signés distants
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Autoriser tous les scripts
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null
OrdinateurParamètre valable pour tout l’ordinateur
.reg
Windows Registry Editor Version 5.00

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

; Options (en utiliser une seule)
; Autoriser uniquement les scripts signés
"ExecutionPolicy"="AllSigned"
; Autoriser les scripts locaux et les scripts signés distants
"ExecutionPolicy"="RemoteSigned"
; Autoriser tous les scripts
"ExecutionPolicy"="Unrestricted"
CMD
:: Options (en utiliser une seule)

:: Autoriser uniquement les scripts signés
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "AllSigned" /f
:: Autoriser les scripts locaux et les scripts signés distants
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
:: Autoriser tous les scripts
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "Unrestricted" /f
PowerShell
# Commun : créer la clé
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Force | Out-Null

# Options (en utiliser une seule)
# Autoriser uniquement les scripts signés
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'AllSigned' -Force | Out-Null
# Autoriser les scripts locaux et les scripts signés distants
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'RemoteSigned' -Force | Out-Null
# Autoriser tous les scripts
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\PowerShell' -Name 'ExecutionPolicy' -PropertyType String -Value 'Unrestricted' -Force | Out-Null