Update-QlikProxy.ps1

function Update-QlikProxy {
    <#
    .SYNOPSIS
    This function ...
 
    .DESCRIPTION
    A bit more description
 
    .PARAMETER FromPipeline
    Shows how to process input from the pipeline, remaining parameters or by named parameter.
 
    .EXAMPLE
    Update-QlikProxy 'abc'
 
    Description of the example.
 
    #>


    <# Enable -Confirm and -WhatIf. #>
    [CmdletBinding(SupportsShouldProcess = $true)]
    param(
       [parameter(Mandatory=$true,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True,Position=0)]
    [string]$id,

    [ValidateRange(1,65536)]
    [Int]$ListenPort,

    [Bool]$AllowHttp,

    [ValidateRange(1,65536)]
    [Int]$UnencryptedListenPort,

    [ValidateRange(1,65536)]
    [Int]$AuthenticationListenPort,

    [Bool]$KerberosAuthentication,

    [ValidateRange(1,65536)]
    [Int]$UnencryptedAuthenticationListenPort,

    [String]$SslBrowserCertificateThumbprint,

    [ValidateRange(1,300)]
    [Int]$KeepAliveTimeoutSeconds,

    [ValidateRange(512,131072)]
    [Int]$MaxHeaderSizeBytes,

    [ValidateRange(20,1000)]
    [Int]$MaxHeaderLines,

    [ValidateRange(1,65536)]
    [Int]$RestListenPort
    )

    begin {
    }

    process {
    $proxy = Get-QlikProxy -raw -Id $id
    if ($listenPort) { $proxy.settings.listenPort = $listenPort }
    $proxy.settings.allowHttp = $allowHttp
    if ($unencryptedListenPort) { $proxy.settings.unencryptedListenPort = $unencryptedListenPort }
    if ($authenticationListenPort) { $proxy.settings.authenticationListenPort = $authenticationListenPort }
    $proxy.settings.kerberosAuthentication = $kerberosAuthentication
    if ($unencryptedAuthenticationListenPort) { $proxy.settings.unencryptedAuthenticationListenPort = $unencryptedAuthenticationListenPort }
    if ($sslBrowserCertificateThumbprint) { $proxy.settings.sslBrowserCertificateThumbprint = $sslBrowserCertificateThumbprint }
    if ($keepAliveTimeoutSeconds) { $proxy.settings.keepAliveTimeoutSeconds = $keepAliveTimeoutSeconds }
    if ($maxHeaderSizeBytes) { $proxy.settings.maxHeaderSizeBytes = $maxHeaderSizeBytes }
    if ($maxHeaderLines) { $proxy.settings.maxHeaderLines = $maxHeaderLines }
    if ($restListenPort) { $proxy.settings.restListenPort = $restListenPort }
    $json = $proxy | ConvertTo-Json -Compress -Depth 10
    return Invoke-QlikPut "/qrs/proxyservice/$id" $json
  }

    end {
    }
}

if ($loadingModule) {
    Export-ModuleMember -Function 'Update-QlikProxy'
}