Issue Description
If you have the command “Get-VM” in your editor and you run “Import-Module VMware.PowerCLI” you get the error “Import-Module : The specified mount name ‘vis’ is already in use.”
- You do not need to run the “Get-VM” command it just need to be on the page.
- You should not trigger the intellisense on “Get-VM”. this will automatically load the module and the “Import-Module VMware.PowerCLI” command will work.
What is the Powershell extension doing when “Get-VM” is in the editor that brake the module import? is it partially loading something?
Steps to Reproduce
- Open Visual Studio Code.
- File > New File.
- Paste code:
Import-Module VMware.PowerCLI
if ($false)
{
Get-VM
}
- Run (F5) or just run “Import-Module VMware.PowerCLI” in console
- Can be reproduced again by killing the terminal and restarting it.
Environment Information
Visual Studio Code
| Name |
Version |
| Operating System |
Windows_NT x64 10.0.17134 |
| VSCode |
1.24.1 |
| PowerShell Extension Version |
1.7.0 |
PowerShell Information
| Name |
Value |
| PSVersion |
5.1.17134.81 |
| PSEdition |
Desktop |
| PSCompatibleVersions |
1.0 2.0 3.0 4.0 5.0 5.1.17134.81 |
| BuildVersion |
10.0.17134.81 |
| CLRVersion |
4.0.30319.42000 |
| WSManStackVersion |
3.0 |
| PSRemotingProtocolVersion |
2.3 |
| SerializationVersion |
1.1.0.1 |
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
| Extension |
Author |
Version |
| Bookmarks |
alefragnani |
0.19.1 |
| bracket-pair-colorizer |
CoenraadS |
1.0.58 |
| code-settings-sync |
Shan |
2.9.2 |
| githistory |
donjayamanne |
0.4.1 |
| gitlens |
eamodio |
8.4.1 |
| PowerShell |
ms-vscode |
1.7.0 |
| rest-client |
humao |
0.18.4 |
| snippet-creator |
nikitaKunevich |
0.0.4 |
| vscode-auto-scroll |
pejmannikram |
1.0.2 |
| vscode-icons |
robertohuertasm |
7.24.0 |
| vscode-postgres |
ckolkman |
1.0.9 |
Ah I didn’t know any of that! Ok, that makes lots of sense. Thanks!
Thanks for that! I suspect it might be PSScriptAnalyzer thing, possibly importing the module in the background and creating the provider. I’ll take a look, but given the specificity of the issue, it might require a community member with more familiarity with the VMWare.PowerCLI module (hence “Up-for-Grabs”).