I ran into an issue while using both the Vmware PowerCLI and System Center Virtual Machine Manager snap-ins for PowerShell. They both contain similarly named cmdlets, like 'Get-VM' and 'Get-VMHost'. It appears that the last snap-in to load wins, so I added logic in my script to load & un-load the snap-in when I needed to get either VMware data or Hyper-V data. I'd like to know if there is any way to prevent this contention, or otherwise create some unique handle to one cmdlet, while still allowing the other to load & operate as intended?
Cmdlet Contention between PowerShell SnapIns
581 Views Asked by rob.rfg At
2
There are 2 best solutions below
Related Questions in POWERSHELL
- PowerShell Linphone Configuration
- How avoid \t being converted to Tab in Powershell
- How do I get my terminal to work in VS Code? Exit Code:2, doesn't allow me to type anything
- Npm command not working in powershell but works in cmd
- Issue with path not being treated as encapsulated when calling cmd /C
- Native command throws error only when I redirect to a variable
- Logic Apps and long running Azure Function (Powershell)
- April fools - PsExec (PsTools)
- How to use nested ForEach-Object
- Batch Script-Powershell MessageBox | How do I set TopMost within PS command line of Batch?
- Execution Stuck at Get-PnPPage if function executed on Button Click
- How can I expand a column from group output?
- How to use expression in regex -replace with capturing group in powershell
- powershell where-object -cnotmatch filter unwanted lines
- How to make Visual Studio 2022 project launch Windows Terminal instead of PowerShell?
Related Questions in POWERCLI
- Ubuntu VM - Running Powershell script - takes snapshot - connects to Jenkins, but reverting to snapshot breaks script
- Cross vCenter vMotion to linked vCenter
- PowerCLI: Disable Internet Connectivy in a vSAN cluster
- Redfish API (Dell) job creation failing
- Powershell or PowerCLI VMDK-to-DriveLetter
- Error invoking a powershell/powercli script via ssh in Windows 2022
- PowerCLI script for patch management
- how to get the last windows update dates in VCenter
- RVTools PowerShell
- ISO not booting using powwershell
- Output of a new line per HardDisk in my script (VMware PowerCLI)
- How to launch an application on VMware Horizon and obtain a web link to its session using PowerCLI?
- Hashtable output is not matching my variable in PowerShell Script
- How do I use a certain output as a variable (in PowerShell)?
- PowerCLi: how get Health status from all hosts
Related Questions in PSSNAPIN
- How to control Get-MailboxFolderStatistics output language?
- Running Powershell 5.1 in a C# / .NET Core 2.1 Application
- Path for Add-PSSnapin not correct when running PowerShell Script from C#
- How to Load Component Services/DCOM Config SnapIn
- Adding a snapin from a module not working like expected
- Powershell 5.1 snap in registration errors
- Oracle Snapins or modules availability
- SQL PowerShell Snapin Problems
- Powershell SnapIn when running in Visual Studio publish
- Snapins loaded from child, not in parent scope when separate files used for Classes
- Windows PowerShell snap-in 'Microsoft.Sharepoint.Powershell' is not installed on this computer?
- Exchange Management Tool Installation Error
- Register Powershell SnapIn to specific version of Powershell
- Powershell Backup snap-in in win7
- Use import-module with a PowerShell PSSnapin Dll
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The best approach when using snapins is to fully qualify the cmdlet name with the snapin name. For instance, if the snapin name for PowerCLI is PowerCLI then use:
For the SCVMM snapin use it's name as a prefix. To see the snapin names, execute: