You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both were working just fine until I upgraded SwisPowerShell to version 3.2.0.50049.
Now, if I load SwisPowerShell first I cannot load VMWare.PowerCli anymore.
And if I load VMWare.PowerCli first, then the Connect-Swis cmdlet returns an error.
This behavior only appears in a PowerShell 7 host (7.3.6 precisely in my case).
Loading SwisPowerShell first
PS>Connect-Swis-Hostname $OrionDatabaseServer-Credential $OrionCred
OperationTimeout Channel ClientChannel ChannelFactory
--------------------------------------------------01:00:00 System.ServiceModel.ChannelFactory`1[SolarWinds.InformationService.Contract2.IStreamInformationServiceChannel]
PS>Import-Module-Name VMware.PowerCLI
Import-Module: Unable to find type [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory].
Loading VMware.PowerCLI first
PS>Import-Module-Name VMware.PowerCLI
Welcome to VMware PowerCLI!
Log in to a vCenter Server or ESX host: Connect-VIServer
To find out what commands are available, type: Get-VICommand
To show searchable help for all PowerCLI commands: Get-PowerCLIHelp
Once you've connected, display all virtual machines: Get-VMIf you need more help, visit the PowerCLI community: Get-PowerCLICommunity Copyright (C) VMware, Inc. All rights reserved.PS> Connect-Swis -Hostname $OrionDatabaseServer -Credential $OrionCredConnect-Swis: The type initializer for 'SolarWinds.InformationService.Contract2.InfoServiceProxy' threw an exception.
Troubleshooting
What is strange is that even after unloading the other module, the issue still remains in both cases.
As a workaround, downgrading SwisPowerShell to version 3.1.0.343 fixes the issue.
I noticed this behavior only in a PS7 host.
So using a PowerShell 5.1 host can be another workaround.
The text was updated successfully, but these errors were encountered:
For me, I noticed that this issue only occurs within Visual Studio Code. I can run scripts directly from a separate PS7 window, but not the integrated terminal in VSCode.
Running:
Visual Studio Code: 1.96.4 (and a few previous versions)
PowerShell 7.5.0 (and a few previous versions)
Both Windows 10 and Windows 11
#Update
I was able to solve the problem for myself by fully removing all of the WMware related modules/packages from PS7. There are a lot that VMware.PowerCLI installs as dependencies, and they're interdependent, so they have to be uninstalled in order. Sorry, I didn't make note of the order.
Both were working just fine until I upgraded SwisPowerShell to version 3.2.0.50049.
Now, if I load SwisPowerShell first I cannot load VMWare.PowerCli anymore.
And if I load VMWare.PowerCli first, then the
Connect-Swis
cmdlet returns an error.This behavior only appears in a PowerShell 7 host (7.3.6 precisely in my case).
Loading SwisPowerShell first
Loading VMware.PowerCLI first
Troubleshooting
What is strange is that even after unloading the other module, the issue still remains in both cases.
As a workaround, downgrading SwisPowerShell to version 3.1.0.343 fixes the issue.
I noticed this behavior only in a PS7 host.
So using a PowerShell 5.1 host can be another workaround.
The text was updated successfully, but these errors were encountered: