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
# MIInvAYJKoZIhvcNAQcCoIInrTCCJ6kCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCqT1gdsE4Yrkq6
# xnvoCy6NcVE63EApk/R1oO9sH4eHPqCCDYUwggYDMIID66ADAgECAhMzAAACU+OD
# 3pbexW7MAAAAAAJTMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD
# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy
# b3Nv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