Public/Update-BicepCLI.ps1

function Update-BicepCLI {
    [CmdletBinding()]
    param (
    )

    if (-not $Script:ModuleVersionChecked) {
        TestModuleVersion
    }
    
    if (!($IsWindows)) {
        Write-Error -Message "This cmdlet is only supported for Windows systems. `
To update Bicep on your system see instructions on https://github.com/Azure/bicep"

        Write-Host "`nCompare your Bicep version with latest version by running Get-BicepVersion`n"
        break
    }

    $versionCheck = CompareBicepVersion

    if ($versionCheck) {
        Write-Host "You are already running the latest version of Bicep CLI."
    }
    else {
        Uninstall-BicepCLI -Force -ErrorAction SilentlyContinue
        Install-BicepCLI -Force
    }
}