It's kind of overwrought syntax, so it's hard to tell. Since you didn't post the error message, I'm just guessing, but personally I'd get rid of all the string concatenation and just use double quotes and subexpressions. I'm also not sure what the [char] type forces are for.
What this is doing is forcing "5" to be of the type [char]. Is that what you intended?
The topic ‘PowerShell script not working from SQL Job step’ is closed to new replies.