Repository navigation
Replies: 2 comments
|
You can't, it requires the msix manifest to be updated. See #27277 |
|
The default-app picker can't do it — the MSIX manifest doesn't declare a %LOCALAPPDATA%\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe (The per-package-family subfolder is better than the generic $pwsh = "$env:LOCALAPPDATA\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe"
$key = 'HKCU:\Software\Classes\Microsoft.PowerShellScript.1\Shell\Open\Command'
New-Item -Path $key -Force | Out-Null
Set-ItemProperty -Path $key -Name '(Default)' -Value "`"$pwsh`" -NoExit -File `"%1`""Double-clicking a Two caveats:
|
Uh oh!
There was an error while loading. Please reload this page.
Motivation: I want to be able to double-click .ps1 scripts in Windows Explorer, for example, and run the script.
PowerShell 7 installed with MSIX is not being offered in the "Set default app" dialog and because the app is located in
C:\Program Files\WindowsAppswhich is owned byTrustedInstalleruser rather than the standard user (even with Administrator permissions), it's impossible to manually assignpwsh.exeto the.ps1extension. Any advice?All reactions