Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

SQL Agent Job - Powerhell Script With Parameters Failing

$
0
0
I have a PS script that has three parameters: -ConfigurationGroup "$ConfigurationGroup" -PolicyCategoryFilter "$PolicyCategoryFilter" -EvalMode "$EvalMode".Some of these values can have spaces in them hence the quotes around the params.When I run this in PS ISE it completes successfully.However when I then try and run it via a SQL Agent job either using Type: Powershell or Operating System (CmdExec) it fails with:Cannot convert the "DBA - DB Config" value of type "System.String" to type "System.Management.Automation.ParameterAttribute".It seems it can handle the spaces in ISE but not SQL Agent job.Any ideas? Do I have to use a different syntax?

Viewing all articles
Browse latest Browse all 467

Latest Images

Trending Articles



Latest Images