I have a bit versed into powershell over the last months, I just cannot stop discovering new gems.
Ex : Win32 Classes
Self-explanatory examples :
PS> (get-wmiobject win32_processor).currentclockspeed
3292
PS> (get-wmiobject win32_operatingsystem).version
5.1.2600
PS> (get-wmiobject win32_proxy).ProxyServer
proxy.example.com
PS> (get-wmiobject win32_proxy).ProxyPortNumber
8080
it goes on and on and on… the ways those things are accessible from the prompt in interactive command line mode or within a script is amazing me
Welcome to the wonderful world of PowerShell. Glad you are liking WMI – you have a lot more to discover. Take a look at Ravikanth’s WMI Query Language ebook for lots more detail on WMI Query Langague and WMI eventing. Look at Richard Siddaway’s book on PowerShell and WMI.
And to learn more – why not come over to PowerShell.Com and join in the forums etc.
Oh yes, I love it from the first page !!!
PS> (Get-WMIObject -query "select freespace from Win32_LogicalDisk where deviceid='C:'").freespace/1e9
455.840509952
Hello,
it looks like this library is deprecated from windows xp. As it looks like here: http://msdn.microsoft.com/en-us/library/aa394520(v=vs.85).aspx
I can’t use it on windows 7. Do you know a painless way to get and set proxy server remotely on windows 7?
Thanks
other than messing up with the registry? I could not find anything in 10-minutes googling
much better :
[Net.HttpWebRequest]::GetSystemWebProxy().GetProxies((new-object Uri(“http://example.com”)))