Array Type data

I want to test the type data on an array, whats the best way to do this

$tawvms.GetType().Fullname System.Object[] $tawvms[0].GetType().Fullname Microsoft.SystemCenter.VirtualMachineManager.VM $tawvms | gm TypeName: Microsoft.SystemCenter.VirtualMachineManager.VM 

I want to confirm the type of the objects in my array er..

if ($tawvms.GetType().Fullname -ne 'Microsoft.SystemCenter.VirtualMachineManager.VM') {do stuff} else {do other stuff} 

what’s the “proper” way of doing this

submitted by /u/BlackV
[link] [comments]

Leave a Reply