Closed flamableassassin closed 1 week ago
You might have to use a different path for profile with vscode. See:
I use following paths for profile, which also loads in VSCode:
# PowerShell 6/7
[System.IO.Path]::Combine(
[System.Environment]::GetFolderPath('MyDocuments'),
'PowerShell',
'Profile.ps1'
)
# Windows PowerShell 5.1
[System.IO.Path]::Combine(
[System.Environment]::GetFolderPath('MyDocuments'),
'WindowsPowerShell',
'Profile.ps1'
)
Or you can modify $env:PSModulePath
in user or system context, then a $profile
is not needed.
# User context
[System.Environment]::SetEnvironmentVariable(
'PSModulePath',
'<value1>;<value2>',
'User'
)
# System context
[System.Environment]::SetEnvironmentVariable(
'PSModulePath',
'<value1>;<value2>',
'Machine'
)
Well I missed the fact that my vscode profile was named Microsoft.VSCode_profile.ps1.ps1
Prerequisites
Summary
To get around https://github.com/PowerShell/PSResourceGet/issues/1494 I've been modifying
$env:PSModulePath
to include a folder where my modules are stored done usingSave-Module
. Due to the extension not loading my Powershell profile the env isn't being modified and is breaking access to modules.PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
NaN
Visuals
No response
Logs
No response