I’ve been using PowerShell Core on my MacBook for a while now. As the code is still in its early stages, there’s no way of managing/updating the software one is running, at least none that I would be aware of. I did miss some updates and, as a result, had problems with Visual Studio Code. So I’ve put together a quick function that checks the latest release on GitHub and can conveniently be put into my
GitHub Releases feed
PowerShell Core was open-sourced some time ago and the team behind it is using GitHub to manage the code. The latest version for all the supported operating systems can be found in the PowerShell repository. Every so often, a new release is published to the Releases feature of GitHub and it happens that GitHub does provide an atom feed for releases. This feed can be accessed by simply appending “.atom” to the URL.
Armed with this information, I wrote the following simple function. It just gets the latest release from the repository’s atom feed and adds the information to a hash table, which is then output as a custom object:
Now I just put the function into my
$PROFILE and make it run every time PowerShell starts.
Easy enough, right?