I have a job that is triggered by files that are created in a number of "failed" folders. Basically another automation is running that processes files through SQL but if the file does not meet the correct naming pattern or the sql results come back bad then the file is placed into a folder labeled "Failed". There are a number of these folders and each folder is a trigger for the VC job.
Ok, so when the failed file comes in I am running a powershell script as the first task to determine the owner of the file. Essentially, who created the file. With this info I can tell them that their file failed.
It was working but now is not.
Here is my PS script
$Path = get-childitem "{TRIGGER(398894c7-a91d-4d6d-b47f-0883752f9a07|LastTrigger|File.Folder)}\{TRIGGER(398894c7-a91d-4d6d-b47f-0883752f9a07|LastTrigger|File.Result.Name)}" -recurse -force
Get-ChildItem $Path -force -Recurse | Select FullName | format-table -AutoSize
Get-ChildItem $Path -force -Recurse | Select CreationTime | format-table -AutoSize
Get-ChildItem $Path -force -Recurse | Select @{N="Owner";E={ (Get-Acl $_.FullName).Owner }} | format-table -AutoSize
So, to translate.
the setting of $Path is just for convenience in the rest of the script. The trigger and variable is correct. If I place that into the VC variables window it does translate to the last file to trigger the job
The next three lines provide that output for a subsequent email. The Full Name of the file, the time it was created and the Owner
All of this works if I pass a folder and file name through but {TRIGGER(398894c7-a91d-4d6d-b47f-0883752f9a07|LastTrigger|File.Folder)}\{TRIGGER(398894c7-a91d-4d6d-b47f-0883752f9a07|LastTrigger|File.Result.Name)} does not work.
The result is shown below
Standard Out and Error
Any ideas?