I have a utility server that I use to administer our vSphere environment. I use PowerCLI pretty heavily. We also have a Hyper-V environment and are starting to increase our scripting and automating of that as well.
The problem is that I'm getting cmdlet conflicts.
> gcm -type cmdlet,function,alias | group name | where { $_.count -gt 1 }
(shows about 20 conflicting commands between Hyper-V and PowerCLI (New-VM, Start-VM, Stop-VM, Get-VM, Export-VM, Get-VMHost, etc).
I don't necessarily want to completely eliminate the Hyper-V module from the server as we are starting to use it and that looks to increase. If there was a way to disable it whenever I am starting PowerCLI or running a PowerCLI script, that would probably be the best option.
I have tried things like:
> (Get-Module -Name Hyper-V) | Remove-Module -Force
But while I get no error, it doesn't seem to remove the cmdlets. I get the same results with the gcm command and I continue to get errors due to conflicts.
Any help would be appreciated.
Thank you