Skip to content

Instantly share code, notes, and snippets.

@ronascentes
Created April 20, 2021 19:46
Show Gist options
  • Save ronascentes/76d75904fc50734636617c82fffce140 to your computer and use it in GitHub Desktop.
Save ronascentes/76d75904fc50734636617c82fffce140 to your computer and use it in GitHub Desktop.
Validating null value in powershell
# If $value is not $null or 0 or $false or an empty string
if ($null -ne $value -and $value -ne 0 -and $value -ne '' -and $value -ne $false ){
:do
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment