Running the below command...
Get-Folder -Name 'sda' | Get-VM
And I get the error....
Get-VM : The Hyper-V Management Tools could not access an expected WMI class on computer 'vm-somedude'. This may indicate that the
Hyper-V Platform is not installed on the computer or that the version of the Hyper-V Platform is incompatible with these management
tools.
LOL, Hyper-V isn't installed at all.
So I try just this...
Get-VM "rhel8"
And I get the same error.
Any ideas?
Thanks
You could just delete the folder.
Are you sure it didn't come with another feature?
Or RSAT?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
OK, so I fully qualified the Get-VM commandlet like this and it works....
Get-Folder -Name 'sda' | VMware.VimAutomation.Core\Get-VM
What's the appropriate fix?
Thanks
With the number of PS modules available, there are bound to be some name collisions going to happen.
There are a number of solutions:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Personally I prefer the Prefix parameter on Import-Module.
You can keep the prefix short.
But it is a problem for your existing scripts.
I tend to move one of the modules (the lesser used) to a folder that is not in $env:PSModulePath.
That solves the module autoloading issue and avoids having to use a fully qualified name on both modules.
When I need the 2nd module, I load it with the Prefix parameter.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm thinking this module is the culprit...
Binary 2.0.0.0 Hyper-V {Add-VMAssignableDevice, Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMGpu...
I ran the command...
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Tools-All
But the module still exists.
How do I get rid of that Powershell Hyper-V module?
You could just delete the folder.
Are you sure it didn't come with another feature?
Or RSAT?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yup, it came with RSAT.
I uninstalled the hyper-v portion and all works now.