I have following powershell script:
But execution of this script giving me error like
Did I make any mistake in calling function with command pipeline from workflow?
Thanks in advance.
When a workflow is run in PowerShell, it's processed by Windows Workflow Foundation (WWF) which translates the PowerShell commands into WWF Activities. Since your Testing function doesn't have an equivalent WWF activity, that means it can't be used in a workflow unless it's placed inside of an inline script block.
Supposedly, the Testing function would need to be in the same script file as the workflow or be placed in a module. I was only able to make it work by placing the Testing function inside of a module that's located in one of the $env:PSModulePath paths that's available to all users, although I didn't spend a lot of time trying to make it work the other way either.
You must be logged in to reply to this topic.