PowerShell Snippet #10 Check Version Number is Valid


Lately I’ve been working on PowerShell Modules that are published to PowerShell Gallery as part of a build process in VSTS. And so I’ve been creating version numbers and passing them as variables. However I wanted to validate them before they were applied. Below is a sample of how to verify that the version number you’re pushing conforms to semver