Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

WMI cmdlets in CTP

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-20-2008   #1 (permalink)
RichS
Guest


 

WMI cmdlets in CTP

I've been looking at the new WMI cmdlets in the CTP - Invoke-WMIMethod and
Set-WMIInstance

Invoke-WmiMethod -Class Win32_process -Name Create -ArgumentList calc.exe

works exactly as you would expect it to

I then moved on to trying the DNS namespace and get errors about the methods
don't exist - when I've used them via V1 syntax.

Couple of questions:

1) If a method is only accessible using a psbase construction eg

$rec = Get-WmiObject -ComputerName DC02 -Namespace 'root\MicrosoftDNS'
-Class MicrosoftDNS_AType -Filter "IPAddress = '192.168.172.20'"
$rec.psbase.Delete()

can I access it via Invoke-WMIMethod

2) Are Invoke-WMIMethod and Set-WMIInstance limied in the namespaces they
can access? Don't see why they should be bu tthey don't seem to like the
MicrosoftDNS namespace

3) if I have multipe arguments for the -ArgumentList parameter in
Invoke-WMIMethod do I need to create a hash table as in Set-WMIInstance.

4) Does the -Flag parameter in Set-WMIInstance actually exist - its in the
documemtation but I get an error saying it doesn't exist when I try to use it

--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk

My System SpecsSystem Spec
Old 01-20-2008   #2 (permalink)
Marco Shaw [MVP]
Guest


 

Re: WMI cmdlets in CTP

RichS wrote:
Quote:

> I've been looking at the new WMI cmdlets in the CTP - Invoke-WMIMethod and
> Set-WMIInstance
>
> Invoke-WmiMethod -Class Win32_process -Name Create -ArgumentList calc.exe
>
> works exactly as you would expect it to
>
> I then moved on to trying the DNS namespace and get errors about the methods
> don't exist - when I've used them via V1 syntax.
>
> Couple of questions:
>
> 1) If a method is only accessible using a psbase construction eg
>
> $rec = Get-WmiObject -ComputerName DC02 -Namespace 'root\MicrosoftDNS'
> -Class MicrosoftDNS_AType -Filter "IPAddress = '192.168.172.20'"
> $rec.psbase.Delete()
>
> can I access it via Invoke-WMIMethod
>
> 2) Are Invoke-WMIMethod and Set-WMIInstance limied in the namespaces they
> can access? Don't see why they should be bu tthey don't seem to like the
> MicrosoftDNS namespace
>
> 3) if I have multipe arguments for the -ArgumentList parameter in
> Invoke-WMIMethod do I need to create a hash table as in Set-WMIInstance.
>
> 4) Does the -Flag parameter in Set-WMIInstance actually exist - its in the
> documemtation but I get an error saying it doesn't exist when I try to use it
>
I've tried asking a private list I am on with a lot of Microsoft folks
on it.

#4 may be just an example of a upcoming feature that was slipped into
the documentation ahead of it actually being programmed in.

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 01-22-2008   #3 (permalink)
Marco Shaw [MVP]
Guest


 

Re: WMI cmdlets in CTP

Quote:

> I've tried asking a private list I am on with a lot of Microsoft folks
> on it.
I was told shortly after that the questions had been forwarded off to
the Microsoft WMI team.

No news otherwise...

Marco
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
sql cmdlets ? PowerShell 3 11-01-2007 12:51 PM
PowerShell CmdLets dm3281 PowerShell 7 10-17-2007 12:31 PM
Quest AD Cmdlets Oisin Grehan PowerShell 4 08-14-2007 07:26 PM
What editor to use on cmdlets? ryanlsanders@gmail.com PowerShell 8 07-22-2007 10:52 AM
save cmdlets Ryan PowerShell 10 04-05-2007 07:27 PM


Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com 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 2005-2008