vscode-powershell extension does not load the Microsoft.VSCode_profile.ps1 in vscode portable mode (with the data/ folder)

Created on 25 Feb 2020  路  6Comments  路  Source: PowerShell/vscode-powershell

System Details

Windows 10 Enterprise (10.0.18363 N/A Build 18363)
VSCode-win32-x64-1.42.1
ms-vscode.powershell-2020.1.0

$PSVersionTable
PSVersion 5.1.18362.628
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.628
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Issue Description

I am experiencing a problem with... the Microsoft.VSCode_profile.ps1 file. The vscode-powershell extension does not load the profile when vscode is ran in portable mode with a data folder.

Expected Behavior

In a normal installation the extension works as expected and loads the file from:

%UserProfile%\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1

Actual Behaviour

However when you use VSCode in portable mode (i.e. make a .\data folder after unzipping the VSCode-win32-x64-1.42.1.zip file, it still tries to load it from the %UserProfile% folder, and not the .\VSCode-win32-x64-1.42.1\data\user-data\User\Microsoft.VSCode_profile.ps1

Area-Configuration Issue-Discussion Up-for-Grabs

Most helpful comment

This does raise the question about expected behaviour (I note in your expected behaviour section, you describe the current behaviour). Certainly no matter where VSCode or where PowerShell is installed, the user directory's location does not change (and PowerShell similarly does not look in a different place for profiles when installed elsewhere).

We should collect more information on this before changing the behaviour, and we should also investigate whether such a change is possible.

All 6 comments

This does raise the question about expected behaviour (I note in your expected behaviour section, you describe the current behaviour). Certainly no matter where VSCode or where PowerShell is installed, the user directory's location does not change (and PowerShell similarly does not look in a different place for profiles when installed elsewhere).

We should collect more information on this before changing the behaviour, and we should also investigate whether such a change is possible.

Thank you very much! Yes, my goal is to make a portable vscode folder with a .\data directory, that has the vscode-powershell plugin which has a Microsoft.VSCode_profile.ps1 in the .\data directory. I was expecting it to readily load the profile from .\VSCode-win32-x64-1.42.1\data\user-data\User\, which I thought would have been great.

Wow you guys are great, I cant wait until it is pushed to the release version. Thank you so much everyone (honestly appreciate how much work and quick turnaround everyone is doing for this). Have a great week.

Wow you guys are great, I cant wait until it is pushed to the release version.

Just to be clear, we haven't acted on this yet. It's not clear that this is behaviour we want. Right now, I can imagine it being a configurable setting perhaps. But it's certainly not a normal thing for the profile file to be relative to the user's location.

We're currently trying to get the extension working well for a release next week, and we have a backlog of requests after that. So I'll mark this up for grabs for now. I should also mention that we're always very happy to review and accept a PR.

Thank you, I wanted to say thank you so much for implementing this guys. You guys are awesome, I confirmed the latest version now has this fixed.

(Future dream request, can you guys make a addon called "vscode-bash" that is similar to the "vscode-powershell" addon? Currently, there is not a bash equivelant to this addon, and it would be my dream to have a addon like that?)

Kind regards, and thank you all so very much.

Glad to hear it's fixed.

can you guys make a addon called "vscode-bash" that is similar to the "vscode-powershell" addon?

Unfortunately, being on the PowerShell team, our mandate is only for PowerShell. You might like something like this (not an endorsement, just the first promising search result).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukegriffith picture lukegriffith  路  3Comments

bgelens picture bgelens  路  3Comments

guidooliveira picture guidooliveira  路  3Comments

nathan-alden-hp picture nathan-alden-hp  路  3Comments

timoline picture timoline  路  3Comments