Summary: Learn how to use a basic inline script in Windows PowerShell workflows.
I’m trying to convert a Windows PowerShell script to a workflow, but I keep running into an error that suggests
the cmdlet cannot be used in a workflow. How can I get around this?
Wrap that section of the workflow as an inline script, and recapture your variables with the Using keyword,
for example:
Inlinescript
{
$Somevariable=Using:SomeVariable
Start-ProblematicFunction $Somevariable
}