Closed d-duer closed 11 months ago
I'm experiencing the same problem for a couple of months. I've seen other people complaining too.
So I was wrong about the 'Bypass' suggestion; that wasn't it. The output of process.env.PSMODULEPATH.split(";")
when ran from the extension is ['C:\Program Files\WindowsPowerShell\Modules', 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules']
, but my $env:PSModulePath
when run from a Powershell window is C:\Users\dduer\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
. When ran from the Powershell terminal in VSCode, it's C:\Users\dduer\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;c:\Users\dduer\.vscode\extensions\ms-vscode.powershell-2023.5.0\modules
.
I don't know much about how environment variables work in difference scopes so I don't know the reason behind the differences, but I'm gonna see if I can figure it out.
Edit: Created https://github.com/Azure/azure-powershell-migration/pull/113/commits/5774312e5ea4a7cea22278045e77f5cef239333b to update the readme
Even after fixing the module issue, I still can't get the extension to do any syntax highlighting. Think I'm just gonna give up on this and use the migration module by itself.
I have the same issue. Installed module without issues but each launch I get the error too that I need to install firstly.
I also get this error message.
While I've the module installed in all possible locations....
Please fix this issue.
Stefan [MSFT]
Resolved by running:
save-module az.tools.migration -Path C:\Windows\system32\WindowsPowerShell\v1.0\Modules
save-module az.tools.migration -Path "C:\program files\powershell\7\Modules"
save-module az.tools.migration -Path "C:\Program Files\WindowsPowerShell\Modules"
from elevated host.
Champion!!!
Even after fixing the module issue, I still can't get the extension to do any syntax highlighting. Think I'm just gonna give up on this and use the migration module by itself.
Hi, the bug that extension doesn't work was fixed, please try az.tools.migration 2.0.0+
Resolved by running:
save-module az.tools.migration -Path C:\Windows\system32\WindowsPowerShell\v1.0\Modules save-module az.tools.migration -Path "C:\program files\powershell\7\Modules" save-module az.tools.migration -Path "C:\Program Files\WindowsPowerShell\Modules"
from elevated host.
yes the version 2.0.0 is not installed in the expected location. I'll consider scan more possible locations. Thanks for reporting.
Component [X] VSCode extension
Description of the issue Every time I open up VSCode, I get the "You have to install Az.Tools.Migration firstly!" error. I do have it installed though. Below is a simplified version of the code that the extension uses in extension.ts and powershell.ts:
When I run that through a typescript debugger within VSCode, it logs 'True'. I noticed that the shell the extension opens up uses -noProfile and executionPolicy: 'Bypass'. Using noprofile locally still returns the same paths in $env:psmodulepath, so I don't think that has anything to do with it. However, when I try to set my execution policy to bypass, I get the following:
Could the extension be bombing out due to that error and not recognizing the existence of the module because of it?