Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Created October 26, 2021 13:14
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 PixelRobots/6c6ba584fdd4825a68161c9b47d31bc2 to your computer and use it in GitHub Desktop.
Save PixelRobots/6c6ba584fdd4825a68161c9b47d31bc2 to your computer and use it in GitHub Desktop.
capture helm and kubectl output to a variable
$command = $(helm uninstall me 2>&1)
if ($command -match 'error' ) {
write-host "error = $command" -ForegroundColor Red
}
$command = $(kubectl apply -f me.yaml 2>&1)
if ($command -match 'errror' ) {
write-host "error = $command" -ForegroundColor Red
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment