Solve methods not working in a PowerShell workflow.

Solve methods that won't work in PowerShell workflows.

John Savill

March 4, 2016

1 Min Read
Solve methods not working in a PowerShell workflow.

Q. I'm trying to use methods of an object within a workflow but they are not working. Why?

A. Typically objects have a number of methods available that are accessed as

Workflow RestrictionCheck{    $msgtest = "Hello"    $msgtest = InlineScript {($using:msgtest).ToUpper()}    Write-Output $msgtest}RestrictionCheck

Note that to access any variables within the InlineScript they must be prefixed with $using: since the InlineScript actually creates a separate PowerShell process, runs the code and returns the objects and therefore ordinarily would not have access to the objects in the parent PowerShell process.

Each week, John Savill answers all of your toughest tech questions about the worlds of Windows Server, Azure, and beyond. Read his past IT advice here, and email your questions to [email protected].

  •  

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like