-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate with tool version managers like Aqua and mise #5123
Comments
I think this is two asks both of which are feasible:
Note that I'm saying this with no familiarity with these exact tools, and am assuming they operate somewhat like the Python and Ruby environment managers. |
I've found a way to do this now using a combination of mise and Scoop. Scoop can create shims, which will create a mise alias for pwshmise uses [alias]
pwsh = 'aqua:PowerShell/PowerShell' After that you can do Scoop shims for specific pwsh versionMy two shims for v7.4 and v7.5: PS > scoop shim add pwsh75 mise "exec [email protected] -- pwsh"
PS > scoop shim add pwsh74 mise "exec [email protected] -- pwsh"
PS > (Get-Command -Name 'pwsh*').Path
C:\Users\olav.birkeland\scoop\persist\mise\mise\installs\pwsh\7.5.0\pwsh.exe
C:\Users\olav.birkeland\SCOOP\apps\mise\current\mise\installs\pwsh\7.5.0\pwsh.exe
C:\Users\olav.birkeland\scoop\shims\pwsh74.exe
C:\Users\olav.birkeland\scoop\shims\pwsh75.exe
PS > Windows TerminalCan use commands and thus mise directly like so in [
{
"commandline": "mise exec [email protected] -- pwsh -NoLogo",
"guid": "{f1781ba6-28e5-4be2-85cf-56a9937de9de}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/pwsh.png",
"name": "PowerShell 7.5 (mise)",
"startingDirectory": "%USERPROFILE%"
},
{
"commandline": "mise exec [email protected] -- pwsh -NoLogo",
"guid": "{f12194ee-663f-4a48-9d6e-166b464afee9}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/pwsh.png",
"name": "PowerShell 7.4 (mise)",
"startingDirectory": "%USERPROFILE%"
}
] VSCode built in terminalCan use commands too. VSCode {
"terminal.integrated.defaultProfile.windows": "PowerShell v7.5 (mise)",
"terminal.integrated.profiles.windows": {
"PowerShell v7.4 (mise)": {
"args": [
"exec",
"[email protected]",
"--",
"pwsh",
"-NoLogo",
"-NoExit",
"-ExecutionPolicy",
"RemoteSigned"
],
"icon": "terminal-powershell",
"overrideName": true,
"path": "mise"
},
"PowerShell v7.5 (mise)": {
"args": [
"exec",
"[email protected]",
"--",
"pwsh",
"-NoLogo",
"-NoExit",
"-ExecutionPolicy",
"RemoteSigned"
],
"icon": "terminal-powershell",
"overrideName": true,
"path": "mise"
},
"Windows PowerShell (x64)": {
"args": [
"/NoLogo",
"/NoExit",
"/ExecutionPolicy",
"RemoteSigned"
],
"overrideName": true,
"path": "${env:SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
},
"Windows PowerShell (x86)": {
"args": [
"/NoLogo",
"/NoExit",
"/ExecutionPolicy",
"RemoteSigned"
],
"icon": "terminal-powershell",
"overrideName": true,
"path": "${env:SystemRoot}\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe"
}
}
} VSCode + vscode-powershellRequires path, can't use command. Here one can use the Scoop shims. VSCode {
"powershell.powerShellAdditionalExePaths": {
"PowerShell v7.5": "C:\\Users\\olav.birkeland\\scoop\\shims\\pwsh75.exe",
"PowerShell v7.4": "C:\\Users\\olav.birkeland\\scoop\\shims\\pwsh74.exe"
},
"powershell.powerShellDefaultVersion": "PowerShell v7.5"
} |
Prerequisites
Summary
There are now multiple multiplatform tools that can manage PowerShell versions as any other dev tool, like:
It'd be cool of
vscode-powershell
somehow could integrate with external tools for easily setting what PowerShell version to run for a session. It doesn't have to be tool specific, but maybe instead of hardcoding a path topwsh.exe
one could do trigger a command:mise use pwsh@<version_supplied_by_vscode_powershell>; mise where pwsh@<version_supplied_by_vscode_powershell>
Which then tells what path to
pwsh.exe
vscode-powershell
should use.Proposed Design
No response
The text was updated successfully, but these errors were encountered: