-
Notifications
You must be signed in to change notification settings - Fork 511
Importing Az Module after Integrated Console has loaded any of the Az* modules will results in no exported commands for said module #2545
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
Importing Az Module after Integrated Console has loaded any of the Az* modules will results in no exported commands for said module #2545
Comments
I suspect this is the same issue as #2397. Can you try out the VSIX in #2397 (comment) and let us know what happens? |
Also, this is known not to happen in PS 6 and 7, since we have a particular solution available in .NET Core only |
Can you try this one: Just want to double check. Note you'll need to uninstall the PowerShell extension and reload VSCode to make sure the PowerShell Preview extension is the one you're seeing work |
Uninstalled the PowerShell extension and the PowerShell Preview extension. Relaunched VSCode. Installed via the ZIP file. Relaunched VSCode. Issue remained. Note: I was trying to run my scripts (Pester Tests) via a PowerShell 7 prompt outside of VSCode with similar results.
I'm having a harder time putting together a simple repo test script for sharing without an attached editor as with VSCode but my scripts are consistently failing.
after my scripts fail I get an empty result as with the original issue. |
Oh! You seem to be loading from the Windows PowerShell module path though. Have you started VSCode from WIndows PowerShell and are running PS 7 in it? |
If so, try starting VSCode from PS 7 |
I removed all Az modules from Windows Powershell's Module path. Reinstalled the required version via PS7 and all is well: Using both the extension you attached and the stable released version 2020.3.0. Seems the transition from Windows PowerShell to PS 7 wasn't seemless for me. Thanks for your assistance, cheers! |
System Details
System Details Output
Issue Description
If a PS1 file is opened that contains an Az module reference and then Import-Module Az is called, the Az cmdlets in the PS1 file will no longer work.
Expected Behaviour
When importing the Az Module, all Az cmdlets should work
Actual Behaviour
If the module is pre-loaded by the Console, the module will not have any exported commands
Attached Logs
Bug.zip contains a PS1 file to use as a way to replicate the behavior.
fail.zip
workaround.zip
Bug.zip
The text was updated successfully, but these errors were encountered: