I have a script that requires a number of parameters:
param ([string]$FOO=\"foo\",[string]$CFG=\'\\ps\\bcpCopyCfg.ps1\', [string]$CFROM=\"none\", `
[string]$
I'm not sure what exactly you're trying to do, but this looks wrong:
start-job -scriptblock {
powershell.exe -file '\ps\bcpCopy.ps1'} -ArgumentList $ARGS
You are creating an entirely new powershell process needlessly. Try this instead:
start-job -scriptblock {
& 'c:\ps\bcpCopy.ps1' @args } -ArgumentList $ARGS
The "@args" syntax is called "splatting." This will expand the passed arguments and ensure each element is treated as a parameter. The ampersand (&) is the "call" operator.