Monthly Archive

Creating a process

I've looked at creating a process before - using [WMIClass].
 
With CTP3 we have a few more options
 
Start-Process -Filepath notepad.exe
 
Invoke-WMIMethod -Class Win32_process -Name Create -ArgumentList notepad.exe
 
Set-WMIinstance -Class Win32_process -Arguments @{Path=c:\windows\system32\notepad.exe}
 
The first two just happen.  The third option will throw an exception because it can't find the instance and then create one.
 
Three options - which to use.  In this case probably start-process but the invoke-wmimethod is useful.

Leave a Reply