Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Created November 17, 2017 09:56
Show Gist options
  • Save mczerniawski/c5d4f5a2df663f9c1f97599d9325d9e1 to your computer and use it in GitHub Desktop.
Save mczerniawski/c5d4f5a2df663f9c1f97599d9325d9e1 to your computer and use it in GitHub Desktop.
$clusterName = 'YourCLusterName'
Get-VM -computername (Get-ClusterNode -Cluster $clusterName).Name |
Get-VMDvdDrive |
Where-Object {$null -ne $_.Path} |
Select-Object VMName,ComputerName,Path |
Out-GridView -PassThru | ForEach-Object {
Set-VMDvdDrive -Path $null -ComputerName $PSItem.ComputerName -VMName $PSItem.VMName -Passthru
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment