Skip to content

Instantly share code, notes, and snippets.

@itpropro
Created June 29, 2019 15:33
Show Gist options
  • Save itpropro/172ff0461c6713ab5ff7e6569543eadc to your computer and use it in GitHub Desktop.
Save itpropro/172ff0461c6713ab5ff7e6569543eadc to your computer and use it in GitHub Desktop.
# Test to write messages to current pipeline. Can be used when in other scope or runspace.
param($msg)
$runspace = [System.Management.Automation.Runspaces.Runspace]::DefaultRunspace
$command = 'Write-Verbose "{0}"' -f $msg
$runspace.CreateNestedPipeline($command, $false).Invoke()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment