mike shaoul
asked on
Powershell command doesn't work
Powershell help needed.
Wish to harden all my vm's on Esxi host. However there is one setting I need help with.
To remove all PCI devices on the vm's.
The vm advance setting would be some thing like ' passthru*present = false, but it doesn't like the wildcard.
There is a get-passthrough command, I tried :
But it returned error:
Wish to harden all my vm's on Esxi host. However there is one setting I need help with.
To remove all PCI devices on the vm's.
The vm advance setting would be some thing like ' passthru*present = false, but it doesn't like the wildcard.
There is a get-passthrough command, I tried :
Connect-VIServer -Server x.x.x.x -Protocol https -User root -Password xxxxxxxxx
$vms = Get-VM | where {$_.PowerState -eq "PoweredOff"}
foreach ($vm in $vms)
{Get-passthroughdevice -vm $vm | Remove-PassthroughDevice}
But it returned error:
Get-passthroughdevice : 04/03/2019 11:23:28 Get-PassthroughDevice Unable to cast object of type 'VMware.Vim.VirtualPCIPassthroughVmiopBackingInfo' to type
'VMware.Vim.VirtualPCIPassthroughDeviceBackingInfo'.
At line:5 char:2
+ {Get-passthroughdevice -vm $vm | Remove-PassthroughDevice}
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-PassthroughDevice], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.GetPassthroughDevice
If your host has a GPU then maybe you hitting this issue ?
https://communities.vmware.com/thread/595706
https://communities.vmware.com/thread/595706
ASKER
I'm using latest powercli and do not have GPU attached
ASKER
ah it appears I have vGPU device installed, with the latest powershell version. What is my fix ?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window