Utils.psm1

function Invoke-CommandLine {
    <#
    .SYNOPSIS
        Execute a command, and check its exit code.
 
    .PARAMETER Command
        Command to execute. It can be a binary file path, or a binary file name found in PATH.
 
    .PARAMETER Arguments
        Arguments to pass to the command.
 
    #>

    Param(
        [Parameter(Mandatory=$true)]
        [String]$Command,

        [String]$Arguments
    )
    & $Command $Arguments.Split(" ")
    if($LASTEXITCODE) {
        Throw "$Command $Arguments returned a non zero exit code ${LASTEXITCODE}."
    }
}

function Add-ToPathEnvVar {
    <#
    .SYNOPSIS
        Append paths to the PATH environment variable.
 
    .PARAMETER Path
        List of paths to be appended to the PATH environment variable.
 
    .PARAMETER Target
        The PATH environment variable target. Valid values are: Machine, User.
 
    #>

    Param(
        [Parameter(Mandatory=$true)]
        [String[]]$Path,

        [Parameter(Mandatory=$false)]
        [ValidateSet([System.EnvironmentVariableTarget]::User, [System.EnvironmentVariableTarget]::Machine)]
        [System.EnvironmentVariableTarget]$Target=[System.EnvironmentVariableTarget]::User
    )
    $pathEnvVar = [Environment]::GetEnvironmentVariable("PATH", $Target).Split(';')
    $currentSessionPath = $env:PATH.Split(';')
    foreach($p in $Path) {
        if($p -notin $pathEnvVar) {
            $pathEnvVar += $p
        }
        if($p -notin $currentSessionPath) {
            $currentSessionPath += $p
        }
    }
    $env:PATH = $currentSessionPath -join ';'
    $newPathEnvVar = $pathEnvVar -join ';'
    [Environment]::SetEnvironmentVariable("PATH", $newPathEnvVar, $Target)
}

function Start-FileDownload {
    <#
    .SYNOPSIS
        Download a file from the given URL.
 
    .PARAMETER URL
        The file download URL.
 
    .PARAMETER Destination
        The local path where the file will be downloaded.
 
    .PARAMETER RetryCount
        The number of retries for the download operation.
 
    #>

    Param(
        [Parameter(Mandatory=$true)]
        [String]$URL,

        [Parameter(Mandatory=$true)]
        [String]$Destination,

        [Int]$RetryCount=10
    )
    Start-ExecuteWithRetry `
        -ScriptBlock { Invoke-CommandLine -Command "curl.exe" -Arguments "-L -s -o $Destination $URL" } `
        -MaxRetryCount $RetryCount `
        -RetryMessage "Failed to download $URL. Retrying"
}

function Invoke-Kubectl {
    <#
    .SYNOPSIS
        Execute a kubectl command.
 
    .PARAMETER Arguments
        Arguments to pass to the command.
 
    #>

    Param(
        [Parameter(Mandatory=$true)]
        [String]$Arguments
    )

    Invoke-CommandLine -Command "kubectl.exe" -Arguments $Arguments
}

function Install-KubernetesManifests {
    <#
    .SYNOPSIS
        Install the Kubernetes manifests given as parameter. The manifests are written into a temporary file, which is given to 'kubectl apply -f <file_path>'.
 
    .PARAMETER Manifests
        The Kubernetes manifests.
 
    #>

    Param(
        [Parameter(Mandatory=$true)]
        [String[]]$Manifests
    )
    $tempFile = New-TemporaryFile
    try {
        foreach($manifest in $Manifests) {
            Set-Content -Path $tempFile -Value $manifest
            Invoke-Kubectl "apply -f ${tempFile}"
        }
    } finally {
        Remove-Item $tempFile
    }
}

function Uninstall-KubernetesManifests {
    <#
    .SYNOPSIS
        Uninstall the Kubernetes manifests given as parameter. The manifests are written into a temporary file, which is given to 'kubectl delete -f <file_path>'.
 
    .PARAMETER Manifests
        The Kubernetes manifests.
 
    #>

    Param(
        [Parameter(Mandatory=$true)]
        [String[]]$Manifests
    )
    $tempFile = New-TemporaryFile
    try {
        foreach($manifest in $Manifests) {
            Set-Content -Path $tempFile -Value $manifest
            Invoke-Kubectl "delete --ignore-not-found=true -f ${tempFile}"
        }
    } finally {
        Remove-Item $tempFile
    }
}

function Start-ExecuteWithRetry {
    <#
    .SYNOPSIS
        Execute the given PowerShell script block until it succeeds, or until the maximum retries count is reached.
 
    .PARAMETER ScriptBlock
        The script block to run.
 
    .PARAMETER MaxRetryCount
        The number of retries before we throw an exception.
 
    .PARAMETER RetryInterval
        Number of seconds to sleep between retries.
 
    .PARAMETER RetryMessage
        Warning message logged on every failed retry.
 
    .PARAMETER ArgumentList
        Arguments to pass to your wrapped commandlet/command.
 
    #>

    Param(
        [Parameter(Mandatory=$true)]
        [ScriptBlock]$ScriptBlock,

        [Int]$MaxRetryCount=10,

        [Int]$RetryInterval=3,

        [String]$RetryMessage,

        [Array]$ArgumentList=@()
    )
    $currentErrorActionPreference = $ErrorActionPreference
    $ErrorActionPreference = "Continue"

    $retryCount = 0
    while ($true) {
        try {
            $res = Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $ArgumentList
            $ErrorActionPreference = $currentErrorActionPreference
            return $res
        } catch [System.Exception] {
            $retryCount++
            if ($retryCount -gt $MaxRetryCount) {
                $ErrorActionPreference = $currentErrorActionPreference
                Throw $_
            } else {
                $prefixMsg = "Retry(${retryCount}/${MaxRetryCount})"
                if($RetryMessage) {
                    Write-Host "${prefixMsg} - $RetryMessage"
                } elseif($_) {
                    Write-Host "${prefixMsg} - $($_.ToString())"
                }
                Start-Sleep $RetryInterval
            }
        }
    }
}

function Get-UniqueId {
    <#
    .SYNOPSIS
        Get an unique id as string. This is based on the value returned from the cmdlet 'New-Guid'.
 
    .PARAMETER Length
        The length of the id string. Minimum allowed is 4, and the maximum is 32. Defaults to 8.
 
    #>

    Param(
        [ValidateRange(4, 32)]
        [Int]$Length=8
    )
    return (New-Guid).Guid.Replace("-", "").Substring(0, $Length)
}

function Get-InputParameter {
    <#
    .SYNOPSIS
        Get an input parameter by interactively asking the user with a prompt.
 
    .PARAMETER Prompt
        The prompt text.
 
    .PARAMETER Description
        The input parameter description.
 
    .PARAMETER Default
        The input parameter default value. Only used when 'Optional' flag is used, and the input parameter is empty.
 
    .PARAMETER Type
        The input parameter will be casted to this type.
 
    .PARAMETER Optional
        If this is enabled, the function allows empty input parameters given by the user.
 
    .PARAMETER AsSecureString
        Flag used if the input parameter is a password. The returned value will
        be a secure string.
 
    .PARAMETER ValidationScriptBlock
        The script block used to validate the input given. It should raise an
        exception (with a meaningful message) if something is wrong with the input
        parameter (which referred as $_ in the script block).
 
    #>

    [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true)]
        [String]$Prompt,

        [String]$Description,

        $Default,

        [ValidateScript({
            if(!($_ -as [type])) {
                Throw "Type '$_' is invalid."
            }
            $true
        })]
        [String]$Type="String",

        [Switch]$Optional,

        [Switch]$AsSecureString,

        [ScriptBlock]$ValidationScriptBlock={$true}
    )
    if($Description) {
        Write-Host -ForegroundColor Green $Description
    }
    if($AsSecureString) {
        $Type = "SecureString"
    }
    do {
        $valid = $true
        try {
            $param = Read-Host -Prompt $Prompt -AsSecureString:$AsSecureString
            if(!$param) {
                if(!$Optional) {
                    Throw "This input parameter is mandatory."
                }
                $param = $Default
            }
            if($AsSecureString -and ![System.Net.NetworkCredential]::new('', $param).Password) {
                Throw "The secret input cannot be empty."
            }
            if($AsSecureString) {
                $paramAgain = Read-Host -Prompt "${Prompt} (again)" -AsSecureString:$AsSecureString
                if([System.Net.NetworkCredential]::new('', $param).Password -ne [System.Net.NetworkCredential]::new('', $paramAgain).Password) {
                    Throw "The repeated secret input parameter does not match."
                }
            }
            $paramType = $Type -as [Type]
            if($paramType.BaseType -eq [Array]) {
                $param = $param.Split(',').Trim()
            }
            $param = [System.Management.Automation.LanguagePrimitives]::ConvertTo($param, $paramType)
            $param | Where-Object $ValidationScriptBlock | Out-Null
        } catch [System.Exception] {
            Write-Warning $_.ToString()
            $valid = $false
        }
    } while(!$valid)
    return $param
}

# SIG # Begin signature block
# MIInwAYJKoZIhvcNAQcCoIInsTCCJ60CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCqT1gdsE4Yrkq6
# xnvoCy6NcVE63EApk/R1oO9sH4eHPqCCDYUwggYDMIID66ADAgECAhMzAAACU+OD
# 3pbexW7MAAAAAAJTMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD
# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy
# b3NvZ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