Skip to content

Instantly share code, notes, and snippets.

@trondhindenes
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trondhindenes/7d2b9b7d63244b209732 to your computer and use it in GitHub Desktop.
Save trondhindenes/7d2b9b7d63244b209732 to your computer and use it in GitHub Desktop.
WorkflowFail2
#Replace PSComputerName with a remote host
workflow FooNoError
{
param($CompName)
InlineScript {
$compName = $using:compName;
"Got $compName"
} -PSComputerName trondcloudDC
}
workflow fooWithError
{
param($CompName)
InlineScript {
$ErrorActionPreference = "Stop"
$compName = $using:compName;
"Got $compName"
} -PSComputerName trondcloudDC
}
#This should work without problems
FooNoError -compname A
FooNoError -compname B
#This fails (the output is always A), - each workflow run will return the same result (which is wrong)
fooWithError -compname A
fooWithError -compname B
#At this point, when running the "FoNoError" again, the workflow will continue to fail until the workflow session on the remote computer is reset or times out (which seems to be around 2 minutes)
FooNoError -compname A
FooNoError -compname B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment