how to pass a script stored in a parameter to a job?


i used following code, doesn't work. how can pass script block parameter start-job?
 $script="my script...."
 start-job -name test -scriptblock {$script}

  $sb={ myscript }  start-job -name test -scr $sb    


[string](0..9|%{[char][int](32+("39826578840055658268").substring(($_*2),2))})-replace "\s{1}\b"


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS