All pastes #337788 Raw Edit

Someone

public text v1 · immutable
·published 2007-02-02 23:52 UTC
rendered paste body
//Working VBS code
set SRP = GetObject("winmgmts:\\.\root\default:SystemRestore")
eSRP = SRP.enable("c:\\")

//Non-working PowerShell code
$sysresconf = Get-WmiObject -namespace root/default -class SystemRestore
echo $sysresconf

//no output returned..

PS C:\Users\Mike\Desktop> $sysresconf.Enable("C:\\")
You cannot call a method on a null-valued expression.
At line:1 char:19
+ $sysresconf.Enable( <<<< "C:\\")