Skip to content

Instantly share code, notes, and snippets.

@aershov24
Created September 23, 2020 06:02
Show Gist options
  • Save aershov24/08d8bfaa2e2278be9b90d14ac7f22638 to your computer and use it in GitHub Desktop.
Save aershov24/08d8bfaa2e2278be9b90d14ac7f22638 to your computer and use it in GitHub Desktop.
Markdium-23 PowerShell Interview Questions DevOps Engineers Must Master
function Test-Output {
Write-Output "Hello World"
}
function Test-Output2 {
Write-Host "Hello World" -foreground Green
}
function Receive-Output {
process { Write-Host $_ -foreground Yellow }
}
#Output piped to another function, not displayed in first.
Test-Output | Receive-Output
#Output not piped to 2nd function, only displayed in first.
Test-Output2 | Receive-Output
#Pipeline sends to Out-Default at the end.
Test-Output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment