Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Last active April 1, 2017 17:19
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 ferventcoder/f058caa451052ab1b37d19ee3404feba to your computer and use it in GitHub Desktop.
Save ferventcoder/f058caa451052ab1b37d19ee3404feba to your computer and use it in GitHub Desktop.
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