Skip to content

Instantly share code, notes, and snippets.

@bizouarn
Last active February 23, 2023 14:18
Show Gist options
  • Save bizouarn/1c7e73a7d649344c9145fb3ff93e7ad9 to your computer and use it in GitHub Desktop.
Save bizouarn/1c7e73a7d649344c9145fb3ff93e7ad9 to your computer and use it in GitHub Desktop.
Gestion des droits d'exécution des scripts powershell (temporairement)
# Stockage de l'ancienne règle
$OldPolicy = (Get-ExecutionPolicy -Scope CurrentUser) | Out-String
echo $OldPolicy # Affiche l'ancienne règle
# Ajout du Bypass
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
# Pour annuler le Bypass (après éxecution des scripts)
Set-ExecutionPolicy -ExecutionPolicy $OldPolicy -Scope CurrentUser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment