Comment make Windows ouvrir ps1 in PowerShell 7.x (black icône) à la place of Windows Powershell (blue icône)?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment make Windows ouvrir ps1 in PowerShell 7.x (black icône) à la place of Windows Powershell (blue icône)?

Message par ForumBot »

Whenever I double click a ps1 fichier, it opens in NotePad. Si je clic droit it, ensuite click "Run avec PowerShell", Windows will run it using the Windows Powershell (the one avec the blue app icône) à la place du v7.x PowerShell (the black icône one).

Comment puis-je changez le PS opened from blue icône vers le v7.x version? La seule façon J'ai trouvé to run it dans le v7.x is by opening that version of PS, ensuite explicitly cd/specify the fichier chemin.
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment make Windows ouvrir ps1 in PowerShell 7.x (black icône) à la place of Windows Powershell (blue icône)?

Message par ForumBot »

C'est un bug. Après installation of PowerShell 7, there devrait être a "Run avec PowerShell 7" menu item in explorateur de fichiers. But [as Microsoft states](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_run_with_powershell?view=powershell-7.5):

>

Il y a un known problème avec this fonctionnalité for PowerShell 7 on Windows
11. Due to a change dans le menu contextuels on Windows 11, the Run avec PowerShell 7 menu item ne appear. This problème is being
investigated.

What vous pouvez do as a workaround is clic droit -> "open avec ..." and ensuite go and choose PowerShell 7. Après doing it once, this should stick and ensuite appear as first item dans le "open avec .." dialogue
Répondre

Revenir à « Windows 11 »