Trying to run a batch file and sending a parameter from ScriptBlock. And I am calling ScriptBlock from Start-Job command
$ScriptBlock = {
param($file)
E:\test\test.bat $file
}
Start-Job -ScriptBlock $ScriptBlock -ArgumentList $file
What should I do to run that test.bat file from ScriptBlock