Powershell - How to filter out objects in a list which are present in another list?
i have loop runs, , has 1 object containing list of virtual machines (this vmware stuff):
$vmlist = get-vm
after point, user chooses vms list , things them, , these vms appended list each time so:
$vmhistory += $chosenvms
after loop around start:
$vmlist = get-vm
what want @ point, filter out $vmlist of virtual machines in $vmhistory object. i've tried:
$vmlist = get-vm | where-object {$_.name -notlike $vmhistory.name}
but doesn't work. dont know how use where-object filter list list.
try changing -notlike -notin.
Windows Server > Windows PowerShell
Comments
Post a Comment