in reply to WMI SubclassesOf $WMIServices not giving all the objects ?
The return from SubclassesOf is a collection. To acess the members of the collection, use the in keyword, which you are importing with your
, in conjunction with a for loop.use Win32::OLE qw (in);
#! perl -slw use strict; use Win32::OLE qw (in); use Data::Dumper; my $Computer = "."; my $WMIServices = Win32::OLE->GetObject("winmgmts:\\\\" . $Computer . +"\\root\\cimv2"); my $test = $WMIServices->SubclassesOf; for my $sub ( in $test ) { print Dumper $sub; }
|
|---|