Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 180259

Clash of the PoSH / PowerCLI cmdlets

$
0
0

So, I learned today the hard way that by adding the vSphere Powercli snapins to my PoSH 3.0 session on a server 2012 with the Hyper-V role enabled, that there are several cmdlet names that clash by name, causing all kinds of havok in my long running, tried & true scripts. Both PowerCLI and PoSH native have Get-VM, Set-VM, Get-Cluster, and many others. The only way to execte them to the right Group is to prefix them with the Module name (Hyper-V\Get-VM). Now this sounds easy, but going through all my existing scripts to fix this is a bit much, and remmebering to do it on the command line will also prove difficult. And it really is a duct tape fix in my opinion.

Since the Hyper-V cmdlets are now native to the PoSH Core, how are we to have the two live in harmony and peace?

I understand that you can add a -Prefix parameter to the end of the Import-Module cmdlet to help (but not fix) this situation, but low and behold, the PowerCLI is still not been made into a proper PoSH module, but still and old PSSnapin.

 

Any ideas?

 

Thanks to all.


Viewing all articles
Browse latest Browse all 180259

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>