Hi
I'm getting in a bit of a tangle here;
I'm trying to provide output to the REST process which is calling my workflow.
<atom:link rel="out-parameter" href="http://loninasu0005.uk.db.com/rest/workflows/d50d03f0-93ca-4a34-a50a-af8fc0766fe9/out
The workflow creates ACL groups in the domain via a PoSH script and I need to pass these values back to the REST process once complete so they can be passed on to the initiator.
The ACL names are logged in a log file which takes the name of the Job ID so easy to track. So far I have been tinkering with the Return Parameters option but not getting far.
In the command I want to interogate the log file for the ACL values and return these if possible.
Any help appreciated.
<command>
Get-WFALogger -Info -message $("Triggering Provisiong command")
$output = get-host
Get-WFALogger -Info -message $output
$PSLogfile = $(Get-WfaRestParameter "jobId")
$expression = $("c:\PROGRA~1\NetApp\WFA-Scripts\VFS_add_new_array-uat-v3.ps1 $dbArray $dbThin $dbCapacity $dbDatacentre $dbReparray $PSLogFile")
Get-WFALogger -Info -message $("Command to invoke: " + $expression)
Get-WFALogger -Info -message "ENV - $env:path "
$output = Invoke-Expression $expression
function OutVars ([string] $var)
{
foreach ($line in $file)
{
if ($line.contains($var))
{
$var = $line.substring($line.indexof(":") +2)
return $var
}
}
}
$file = Get-Content c:\PROGRA~1\NetApp\WFA-PSLogs\LOG-ID-$PSLogfile.log
$aclr = OutVars "ACLR"
$aclc = OutVars "ACLC"
Add-WfaWorkflowParameter -Name ACLR -Value $aclr -AddAsReturnParameter
Add-WfaWorkflowParameter -Name ACLC -Value $aclc -AddAsReturnParameter
# print the output of the exe
Get-WFALogger -Info -message "----------------------------------------------------------------------------------"
foreach($line in $output)
{
if($line)
{
Get-WFALogger -Info -message $line
}
}
Get-WFALogger -Info -message "----------------------------------------------------------------------------------"