Skip to content

Instantly share code, notes, and snippets.

@jcpowermac
Created December 11, 2013 18:46
Show Gist options
  • Save jcpowermac/7916110 to your computer and use it in GitHub Desktop.
Save jcpowermac/7916110 to your computer and use it in GitHub Desktop.
vSphere ESXi PCI Passthru
$vmhosts = Get-VMHost
foreach( $vmhost in $vmhosts )
{
$hcv = $vmhost | Get-View | Select Config
$hcmv = $vmhost | Get-View | Select ConfigManager
$pci = Get-View -Id $hcmv.ConfigManager.PciPassthruSystem
$pci.Refresh();
$ptis = $hcv.Config.PciPassthruInfo;
foreach( $pti in $ptis ) {
if( $pti.PassthruCapable -eq "True" ) {
$vmhost;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment