Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

Got it, try like this

If you want to display more properties in the first Select, you will have to add calculated properties to that Select.

Get-VMHost | Get-VMHostService |where {$_.Key -eq 'TSM-SSH' -and $_.Running} |

select @{N='ESX';E={$_.VMHost.Name}},@{N='Service';E={$_}} |

Out-GridView -OutputMode Multiple -Title "Select ESX where SSH should be stopped" |

select -ExpandProperty Service |

Stop-VMHostService -Confirm:$false


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post