Skip to content

Instantly share code, notes, and snippets.

@patrickkettner
Created November 30, 2012 02:37
Show Gist options
  • Save patrickkettner/4173432 to your computer and use it in GitHub Desktop.
Save patrickkettner/4173432 to your computer and use it in GitHub Desktop.
How to do basic ternary operations in Powershell
$variable_to_set = if ($variable_to_check -gt 0 ) { 1 } else { -1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment