Comment ajouter Modifier ou Exécuter avec au menu contextuel du fichier PS1

Comment ajouter Modifier ou Exécuter avec au menu contextuel du fichier PS1

Un fichier PS1 est un script ou une applet de commande utilisé par Windows PowerShell .

Ce guide vous montrera comment ajouter ou supprimer un menu Modifier ou Exécuter avec personnalisé dans le menu contextuel des fichiers PowerShell .ps1 pour tous les utilisateurs de Windows 10 .

Le menu contextuel Modifier ou Exécuter avec comprend les éléments suivants pour les fichiers PS1 :

  • Exécuter avec PowerShell
  • Exécuter avec PowerShell en tant qu'administrateur
  • Exécuter avec PowerShell 7
  • Exécuter avec PowerShell 7 en tant qu'administrateur
  • Modifier avec PowerShell ISE
  • Modifier avec PowerShell ISE en tant qu'administrateur
  • Modifier avec PowerShell ISE (x86)
  • Modifier avec PowerShell ISE (x86) en tant qu'administrateur
  • Modifier avec le Bloc-notes
  • Modifier avec le Bloc-notes en tant qu'administrateur

Comment ajouter Modifier ou Exécuter avec au menu contextuel du fichier PS1

Ajoutez « Modifier ou exécuter avec » au menu contextuel du fichier PS1 dans Windows 10

Comment ajouter « Modifier ou exécuter avec » au menu contextuel du fichier PS1 dans Windows 10

Voici comment:

1. Effectuez l'étape 2 (ajouter - clic droit), l'étape 3 (ajouter - Maj + clic droit) ou l'étape 4 (supprimer) ci-dessous selon ce que vous souhaitez faire.

2. Pour ajouter le menu contextuel du fichier PS1 « Modifier ou exécuter avec » (cliquez simplement avec le bouton droit pour afficher), téléchargez le fichier Add_Edit_or_Run_with_to_PS1_context_menu.reg .

Contenu du fichier REG) - Code :

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\.ps1]

[HKEY_CLASSES_ROOT\.ps1]
@="Microsoft.PowerShellScript.1"

[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
"EditFlags"=dword:00020000
"FriendlyTypeName"=hex(2):40,00,22,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,\
  00,72,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
  33,00,32,00,5c,00,77,00,69,00,6e,00,64,00,6f,00,77,00,73,00,70,00,6f,00,77,\
  00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,5c,00,76,00,31,00,2e,00,30,00,\
  5c,00,70,00,6f,00,77,00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,2e,00,65,\
  00,78,00,65,00,22,00,2c,00,2d,00,31,00,30,00,33,00,00,00

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\",1"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell]
@="Open"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]
"MUIVerb"="Edit or Run with"
"Extended"=-
"SubCommands"=""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout]
"MUIVerb"="Run with PowerShell"
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout]
"MUIVerb"="Run with PowerShell as administrator"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"\"& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""



[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout]
"MUIVerb"="Run with PowerShell 7"
"Icon"="pwsh.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout]
"MUIVerb"="Run with PowerShell 7 as administrator"
"HasLUAShield"=""
"Icon"="pwsh.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"\"& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout]
"MUIVerb"="Edit with PowerShell ISE"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout]
"MUIVerb"="Edit with PowerShell ISE as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout]
"MUIVerb"="Edit with PowerShell ISE (x86)"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout\Command]
@="\"C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout]
"MUIVerb"="Edit with PowerShell ISE (x86) as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout]
"MUIVerb"="Edit with Notepad"
"Icon"="notepad.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout]
"MUIVerb"="Edit with Notepad as administrator"
"HasLUAShield"=""
"Icon"="notepad.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\Windows\\System32\\notepad.exe \"\"%1\"\"'  -Verb RunAs\""

3. Pour ajouter le menu contextuel du fichier PS1 "Modifier ou exécuter avec" (appuyez sur Shift + clic droit pour afficher), téléchargez le fichier Add_Shift + Edit_or_Run_with_to_PS1_context_menu.reg .

Contenu du fichier REG - Code :

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\.ps1]

[HKEY_CLASSES_ROOT\.ps1]
@="Microsoft.PowerShellScript.1"

[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
"EditFlags"=dword:00020000
"FriendlyTypeName"=hex(2):40,00,22,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,\
  00,72,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
  33,00,32,00,5c,00,77,00,69,00,6e,00,64,00,6f,00,77,00,73,00,70,00,6f,00,77,\
  00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,5c,00,76,00,31,00,2e,00,30,00,\
  5c,00,70,00,6f,00,77,00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,2e,00,65,\
  00,78,00,65,00,22,00,2c,00,2d,00,31,00,30,00,33,00,00,00

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\",1"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell]
@="Open"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]
"MUIVerb"="Edit or Run with"
"Extended"=""
"SubCommands"=""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout]
"MUIVerb"="Run with PowerShell"
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout]
"MUIVerb"="Run with PowerShell as administrator"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"\"& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""



[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout]
"MUIVerb"="Run with PowerShell 7"
"Icon"="pwsh.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout]
"MUIVerb"="Run with PowerShell 7 as administrator"
"HasLUAShield"=""
"Icon"="pwsh.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"\"& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout]
"MUIVerb"="Edit with PowerShell ISE"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout]
"MUIVerb"="Edit with PowerShell ISE as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout]
"MUIVerb"="Edit with PowerShell ISE (x86)"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout\Command]
@="\"C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout]
"MUIVerb"="Edit with PowerShell ISE (x86) as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout]
"MUIVerb"="Edit with Notepad"
"Icon"="notepad.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout]
"MUIVerb"="Edit with Notepad as administrator"
"HasLUAShield"=""
"Icon"="notepad.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\Windows\\System32\\notepad.exe \"\"%1\"\"'  -Verb RunAs\""

4. Pour supprimer le menu contextuel du fichier PS1 « Modifier ou exécuter avec », téléchargez le fichier Remove_Edit_or_Run_with_from_PS1_context_menu.reg .

Contenu du fichier REG - Code :

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]

5. Enregistrez le fichier .reg sur le bureau.

6. Double-cliquez sur le fichier .reg téléchargé pour fusionner.

7. Lorsque vous y êtes invité, cliquez sur Exécuter > Oui (UAC) > Oui > OK pour approuver la fusion.

8. Vous pouvez maintenant supprimer le fichier .reg téléchargé si vous le souhaitez.

J'espère que vous réussirez.


Comment installer OpenSSH sur Windows 10

Comment installer OpenSSH sur Windows 10

Vous pouvez désormais utiliser OpenSSH sur Windows 10 pour vous connecter à des serveurs distants à l'aide de SSH sans installer d'outils tiers. Cet article vous montrera comment installer le client OpenSSH sur Windows 10.

Comment vérifier que la fonctionnalité Ensembles est activée sur la version Windows 10 Insider Preview

Comment vérifier que la fonctionnalité Ensembles est activée sur la version Windows 10 Insider Preview

Rejoignez LuckyTemplates pour savoir comment vérifier que la fonctionnalité Ensembles est activée sur votre version Windows 10 Insider Preview dans cet article !

Instructions pour rétrograder Windows 10 Mobile vers Windows Phone 8.1

Instructions pour rétrograder Windows 10 Mobile vers Windows Phone 8.1

De nombreux fans de Windows Phone ont mis à niveau leurs téléphones vers Windows 10 Mobiles. Cependant, après une période d'utilisation, de nombreux utilisateurs ont découvert que cette plateforme comportait encore de nombreuses erreurs et souhaitaient revenir à Windows Phone 8.1 comme avant.

Comment empêcher Windows de mettre automatiquement à jour les cartes hors ligne

Comment empêcher Windows de mettre automatiquement à jour les cartes hors ligne

Si vous ne le savez pas, l'application de cartographie intégrée à Windows est optimisée par Microsoft Bing Maps et est utilisée pour référencer rapidement des directions vers un emplacement spécifique en cas de besoin.

Comment empêcher les utilisateurs daccéder aux lecteurs pour des raisons de sécurité sous Windows

Comment empêcher les utilisateurs daccéder aux lecteurs pour des raisons de sécurité sous Windows

Lorsque vous ne souhaitez pas que d'autres utilisateurs accèdent à tout ou partie de vos lecteurs, vous pouvez utiliser des GPO pour restreindre rapidement l'accès. Voici les étapes pour empêcher les utilisateurs d’accéder aux lecteurs sous Windows.

Configurer Always On VPN dans Windows 10 à laide de Microsoft Intune

Configurer Always On VPN dans Windows 10 à laide de Microsoft Intune

Always On VPN est conçu pour utiliser les plateformes de gestion des appareils mobiles (MDM) telles que Microsoft Intune. Grâce à Intune, les administrateurs peuvent créer et déployer des profils VPN distribués sur n'importe quel appareil Windows 10, n'importe où.

Points à garder à l’esprit lors de l’utilisation de l’UEFI au lieu du BIOS

Points à garder à l’esprit lors de l’utilisation de l’UEFI au lieu du BIOS

Les nouveaux ordinateurs Windows 8 n'utilisent pas le BIOS traditionnel, mais utilisent plutôt le micrologiciel UEFI comme les Mac l'avaient fait il y a des années. La manière dont vous pouvez effectuer les tâches système courantes a changé.

Instructions pour récupérer la capacité USB perdue

Instructions pour récupérer la capacité USB perdue

J'ai récemment rencontré un problème étrange : ma clé USB de 4 Go s'est soudainement transformée en une clé USB de 100 Mo. J'ai perdu une énorme partie de mon espace de stockage. Heureusement, j'ai trouvé un moyen de les corriger. Si vous rencontrez une situation similaire, soyez assuré que la solution à cette erreur est étonnamment simple.

7 erreurs à éviter lors du test de la vitesse du Wi-Fi

7 erreurs à éviter lors du test de la vitesse du Wi-Fi

Un moyen simple de confirmer qu’il y a un problème consiste à tester la vitesse du Wi-Fi. C'est très facile à faire. Il existe de nombreux services de test de vitesse Wi-Fi en ligne qui s'exécutent dans le navigateur.

Comment épingler des applications à la barre des tâches pour souvrir plus rapidement

Comment épingler des applications à la barre des tâches pour souvrir plus rapidement

Il existe de nombreuses façons d'épingler des applications dans la barre des tâches, également appelées amener l'icône de l'application dans la barre des tâches. Ci-dessous, Quantrimang.com vous indiquera les 2 moyens les plus simples et les plus rapides d'épingler des logiciels et des applications dans la barre des tâches. Vous invite à suivre hors ligne.