powershell - powercli - (VMWare) How to use get-view -filter to use -notlike RRS feed

  • Question

  • I would like to simply be able to use the get-view cmdlet to search for VMs with properties which do NOT contain certain things. 

    I have searched high and low on the internet and everyone uses get-view to search for things which match a certain criteria i.e

    for example this is possible:

    $filter = @{"Name" = "Panda"}
    get-view -viewtype virtualmachine -filter $filter

    However if i want to search for VMs which do not contain "Panda", to simply change it to 

    $filter =@{"Name" -notlike "Panda"}
    get-view -viewtype virtualmachine -filter $filter

    will not work and I cannot determine why

    Monday, January 23, 2017 10:19 PM