Automation

 View Only
  • 1.  PowerCLI Unmount VMware tools install

    Posted Jun 01, 2017 01:34 AM

    how can I check if vmware tools is mounted on a vm, and if so, automatically unmount install?

    Thanks!



  • 2.  RE: PowerCLI Unmount VMware tools install
    Best Answer

    Posted Jun 01, 2017 04:42 AM

    You could do something like this

    Get-VM | Get-CDDrive | where{$_.IsoPath -match "vmware/isoimages"} |

    Set-CDDrive -NoMedia -Confirm:$false



  • 3.  RE: PowerCLI Unmount VMware tools install

    Posted Jun 01, 2017 04:45 AM

    Hi there,

    The following should unmoun the Tools media if mounted on a VM;

    Get-VM | ? {$_.ExtensionData.Runtime.ToolsInstallerMounted -eq $true } | Dismount-Tools

    You can scope by adjusting the parameter for the Get-VM (eg. Get-VM "LAB*" | ? {$_.ExtensionData.Runtime.ToolsInstallerMounted -eq $true } | Dismount-Tools) or add a Get-ResorucePool XXX or Get-Cluster XXX to the pipe (Get-Cluster Lab | Get-VM | ? {$_.ExtensionData.Runtime.ToolsInstallerMounted -eq $true } | Dismount-Tools)

    Kind regards,

    Adrian



  • 4.  RE: PowerCLI Unmount VMware tools install

    Posted Jun 03, 2017 03:44 AM

    thanks all!