Skip to content

Instantly share code, notes, and snippets.

@mattruma

mattruma/ValidateVersion.ps1 Secret

Created Dec 3, 2020
Embed
What would you like to do?
Adventures with Azure DevOps: Assembly Version Validation
Param(
[String] [Parameter(Mandatory = $true)] $Url,
[String] [Parameter(Mandatory = $true)] $Version
)
Write-Host "Url: $($Url)."
Write-Host "Version: $($Version)."
$Response = (Invoke-WebRequest -URI $Url)
$StatusCode = $Response.StatusCode
Write-Host "Status Code: $($StatusCode)."
$Content = $Response.Content | ConvertFrom-Json
If ($Content.version -ne $Version) {
Write-Host "Result: Failed."
Write-Error "Expected version to be $($Version) but received $($Content.version)."
} Else {
Write-Host "Result: Success."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment