Last active
August 29, 2015 14:02
-
-
Save trondhindenes/7d2b9b7d63244b209732 to your computer and use it in GitHub Desktop.
WorkflowFail2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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
If you can repro, please vote up at https://connect.microsoft.com/PowerShell/feedback/details/894721/workflows-using-multiple-inlinescripts-with-the-pscomputername-does-not-get-correct-variables-from-the-workflow-when-using-using-scoping
If not, please let me know!