zik
Enthusiast
Enthusiast

You could use a switch statement:

get-vm | %{

switch ($_.ExtensionData.Config.GuestFullname)

    {

        "Microsoft Windows Server 2012 (64-bit)" {"Do one thing"}

        "Red Hat Enterprise Linux 6 (64-bit)" {"Do another"}

        default {"I don't know what to do with $_"}

    }

}

Reply
0 Kudos