My issue related to following newsblog:
https://devblogs.microsoft.com/powershell/introducing-powershell-as-net-global-tool/
I have uninstalled PowerShell 6.2.2 to test installation via dotnet tool install --global PowerShell
Everything is working fine.
Unfortunately, VSCode powershell extensions can't automatically pick up PowerShell installed as .net core global tool and falls back to built-in windows powershell 5.1.
For example, I can't change language mode
Can you modify autodetection mechanics so powershell as global tools picked up correctly?
Thanks for opening this issue @maximpashuk it looks like we need to incorporate ~.dotnet\tools\pwsh.exe into the paths we check for all available PowerShell versions on a system.
This is what I do for my scoop-installed powershells, you can do the same for the dotnet tools global folder
"powershell.powerShellAdditionalExePaths": [
{
"exePath": "C:/Users/JGrote/scoop/apps/pwsh/current/pwsh.exe",
"versionName": "Powershell"
},
{
"exePath": "C:/Users/JGrote/scoop/apps/pwsh-preview/current/pwsh.exe",
"versionName": "Powershell Preview"
}
],
According to
https://github.com/PowerShell/vscode-powershell/pull/2503
this issue seems to be fixed, so I close it.
This does not work for me. I just tried re-installing dotnet tool install --global PowerShell but that doesn't change anything.
dotnet tool install --global PowerShellcode .Terminal: Select Default ShellExpected behavior: The list of available shells will include pwsh using the dotnet tool global path.
Actual behavior: There is no pwsh listed.
The "powershell.powerShellAdditionalExePaths" workaround doesn't work either.
VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:13:20.174Z)
OS version: Windows_NT x64 10.0.18363
> dotnet tool list --global
Package Id Version Commands
-------------------------------------------------------------
powershell 7.0.1 pwsh
> (Get-Command pwsh).Source
C:\Users\alais\.dotnet\tools\.store\powershell\7.0.1\powershell\7.0.1\tools\netcoreapp3.1\any\win\pwsh.exe
> $env:Path
C:\Users\alais\.dotnet\tools\.store\powershell\7.0.1\powershell\7.0.1\tools\netcoreapp3.1\any\win; ... ; ...
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (6 x 3408)|
|GPU Status|2d_canvas: unavailable_software
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: disabled_software
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: unavailable_software
webgl2: unavailable_software|
|Load (avg)|undefined|
|Memory (System)|29.44GB (9.62GB free)|
|Process Argv|.|
|Screen Reader|no|
|VM|0%|
Extensions (33)
Extension|Author (truncated)|Version
---|---|---
vscode-openapi|42C|3.3.0
Bookmarks|ale|11.3.1
project-manager|ale|11.1.0
vscode-json|and|1.5.0
vscode-markdownlint|Dav|0.36.1
xml|Dot|2.5.0
gitlens|eam|10.2.2
eppz-code|epp|1.2.41
vsc-material-theme|Equ|32.8.0
vsc-material-theme-icons|equ|1.1.4
easy-icons|jam|0.3.1
azure-pipelines|ms-|1.170.0
vscode-azureappservice|ms-|0.17.0
vscode-azurefunctions|ms-|0.22.1
vscode-azureresourcegroups|ms-|0.2.0
vscode-azurestorage|ms-|0.9.0
vscode-azurevirtualmachines|ms-|0.1.1
vscode-cosmosdb|ms-|0.13.0
vscode-docker|ms-|1.3.1
csharp|ms-|1.22.1
vscode-dotnet-runtime|ms-|0.1.2
remote-wsl|ms-|0.44.4
azure-account|ms-|0.8.11
azurecli|ms-|0.5.0
powershell|ms-|2020.6.0
vscode-node-azure-pack|ms-|0.0.11
team|ms-|1.161.0
azurerm-vscode-tools|msa|0.11.0
vscode-json-editor|nic|0.2.3
quicktype|qui|12.0.46
vscode-yaml|red|0.8.0
code-spell-checker|str|1.9.0
unique-window-colors|stu|1.0.51
(10 theme extensions excluded)
@mromanch thanks for this comment, if you would like to have PowerShell show up as an option for Terminal:Default Shell please open an issue in VSCode's repo as that is one of their editor commands that they would need to update to search for the global tool path...the additionalexespath setting influences the integrated console (rather than the terminal)...apologies for any confusion!
Most helpful comment
Workaround
This is what I do for my scoop-installed powershells, you can do the same for the dotnet tools global folder