Backgroup job does not work


there 2 variables
1) $cmd (.\findunlinkedgpos.ps1 -query -domain jhu.local)
2) $path (c:\tempps\findunlinkedgpos.txt)

this command works fine.
invoke-expression -command $cmd | out-file $path

this command not work.
start-job -name gpocom01 -argumentlist $cmd, $path -scriptblock {param($c,$p) invoke-expression $c | out-file $p}


first command tells there 1 unlinked gpo.
second command creates output file file empty. can me?

merry xmas everyone!!

 $cmd -  try using full path , in script findunlinkedgpos contains import-module grouppolicy?


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file