AnsweredAssumed Answered

Powershell Task - Error in Workflow

Question asked by paul.oleary1 on May 21, 2015
Latest reply on May 22, 2015 by snoopj123

Trying to execute a task inside a workflow. The task is a powershell call that tries to use the VMware Provision Inputs value of vmNameorPrefix as the basis for creating an AD object with the simple powershell script command new-adcomputer.

The script is functional on the Agent when run manually, but I seem to be unable to either parse the ${vmNameorPrefix} variable from the workflow properly or something else is awry.

 

Any help will be appreciated as the docco is vague on how exactly to use values within the workflow.

 

May 22, 2015 06:01:29 EST Task: Basic VM Deployment (Execute PowerShell Command) failed with error - Command faileError while executing command: java.lang.Exception: Error code: 3, error message: Exception while executing script, selectedContext=<None>

May 22, 2015 06:01:29 EST Task #4 (Basic VM Deployment (Execute PowerShell Command)) failed after 1 seconds

May 22, 2015 06:01:29 EST Input/Output values for Task #4 (Basic VM Deployment (Execute PowerShell Command)):

May 22, 2015 06:01:29 EST [Local Input: Label = Make AD Object]

May 22, 2015 06:01:29 EST [Local Input: PowerShell Agent = 192.168.0.2]

May 22, 2015 06:01:29 EST [Local Input: Target Machine IP = 192.168.0.2]

May 22, 2015 06:01:29 EST [Local Input: User ID = ADUSER]

May 22, 2015 06:01:29 EST [Local Input: Password = **masked-value**]

May 22, 2015 06:01:29 EST [Local Input: Domain = TEST]

May 22, 2015 06:01:29 EST [Template Input:Commands/Script = $vm = '${vmNameorPrefix}' Start-Job -FilePath C:\\Source\\Scripts\\ADD_AD_Computer.ps1 -ArgumentList \$vm |Wait-Job |Receive-Job]

May 22, 2015 06:01:29 EST [Resolved Template Input: Commands/Script = = '' Start-Job -FilePath C:\Source\Scripts\ADD_AD_Computer.ps1 -ArgumentList $vm |Wait-Job |Receive-Job]

May 22, 2015 06:01:29 EST [Local Input: Commands/Script = = '' Start-Job -FilePath C:\Source\Scripts\ADD_AD_Computer.ps1 -ArgumentList $vm |Wait-Job |Receive-Job]

May 22, 2015 06:01:29 EST [Local Input: Maximum Wait Time = 5]

May 22, 2015 06:01:29 EST Completed workflow item number 5, with status Failed

May 22, 2015 06:01:29 EST Task: Basic VM Deployment (Execute PowerShell Command) failed with error - Command faileError while executing command: java.lang.Exception: Error code: 3, error message: Exception while executing script, selectedContext=<None>

Outcomes