I have the following:
Workflow Test {
$message = "Hey"
InlineScript{
Write-Output $using:message
Read-Host 'Get user input before proceeding.'
}
InlineScript{
Write-Output $using:message
}
}
Test
What I get in return:
A command that prompts the user failed because the host program or the command type does not support user interaction.
Is there any way to tell a workflow to pause for user input before proceeding? I'm using Workflows to support parallel foreach - but I want to pause between operations.
I could try this:
Workflow Test1 {
$message = "Hey"
InlineScript{
Write-Output $using:message
Read-Host 'Get user input before proceeding.'
}
}
Workflow Test2 {
$message = "Hey"
InlineScript{
Write-Output $using:message
}
}
Test1
// wait for user input
Test2
But then I have repeated constants there - $message - which isn't very DRY.
InlineScriptto support all PowerShell commands is because it's a different environment, so you can think of those blocks as running in a different runspace.