Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unlock Functionality in Newer Versions with PolyFill for older
if ([System.Version]$env:CHOCOLATEY_VERSION -ge [System.Version]'0.10.4'){
# do something awesome
} else {
# implement additional functionality
}
@ferventcoder
Copy link
Author

ferventcoder commented Apr 1, 2017

In case POSH v2 doesn't like the above:

if ($env:CHOCOLATEY_VERSION -and [System.Version]$env:CHOCOLATEY_VERSION -ge [System.Version]'0.10.4'){
  # do something awesome
} else {
  # implement additional functionality
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment