Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Is easier WMI static class access in the works for 1.1+?

Reply
 
Old 09-15-2006   #1 (permalink)
Alex K. Angelopoulos [MVP]


 
 

Is easier WMI static class access in the works for 1.1+?

First of all, my compliments on the fact that Get-WmiObject -List _does_
return static class references. There are times when you absolutely need
them, and although we could take other avenues to getting to them, being
able to use the cmdlet makes life much better.

Unfortunately, it's a bit awkward trying to access a specific static class
or subset of the classes. You can do
Get-WmiObject -List
and get back every class on the system, but you cannot pre-filter; you get
every class in the namespace back, which on my system (AMD 1.67GHz, 768 MiB
RAM) takes about 10-12 times as long as directly get all instances of, say,
Win32_NetworkAdapterConfiguration.

This is livable in most cases, but if we don't have a WMI provider in the
works for v1.1, static class access is important in analyzing classes and is
a requirement for invoking static methods of the class. Are we planning on
doing anything to simplify static access?

The simplest way might be to add a WmiBase property to WMI objects, allowing
easy access to the underlying class. This is probably doable now (although I
haven't yet thought about it in detail). Another option would be to allow
the -List parameter to accept a wildcard-supporting <string[]>.



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Vista: static works, DHCP does not work Vista networking & sharing
how to call a static method in a .net class from powershell? PowerShell
Access a static member on a nested static class. PowerShell
Access a static member on a nested static class. PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46