Qlik-Cli-Windows icon indicating copy to clipboard operation
Qlik-Cli-Windows copied to clipboard

Please add task name to Update-QlikReloadTask in resources/task.ps1

Open simonaubertbd opened this issue 2 years ago • 0 comments

Very useful to rename task

function Update-QlikReloadTask {
    [CmdletBinding()]
    param (
        [parameter(Mandatory = $true, ValueFromPipeline = $True, ValueFromPipelinebyPropertyName = $True, Position = 0)]
        [string]$id,
        [Bool]$Enabled,
	[string]$Name,
        [ValidateRange(1, 2147483647)]
        [Int]$TaskSessionTimeout,
        [ValidateRange(0, 20)]
        [Int]$MaxRetries,
        [string[]]$customProperties,
        [string[]]$tags
    )

    PROCESS {
        $task = Get-QlikReloadTask -Id $id -raw
        If ( $psBoundParameters.ContainsKey("Enabled") ) { $task.enabled = $Enabled }
	If ( $psBoundParameters.ContainsKey("Name") ) { $task.name = $Name }
        If ( $psBoundParameters.ContainsKey("TaskSessionTimeout") ) { $task.taskSessionTimeout = $TaskSessionTimeout }
        If ( $psBoundParameters.ContainsKey("MaxRetries") ) { $task.maxRetries = $MaxRetries }
        if ($PSBoundParameters.ContainsKey("customProperties")) { $task.customProperties = @(GetCustomProperties $customProperties) }
        if ($PSBoundParameters.ContainsKey("tags")) { $task.tags = @(GetTags $tags) }

        $json = $task | ConvertTo-Json -Compress -Depth 10
        return Invoke-QlikPut -path "/qrs/reloadtask/$id" -body $json
    }
}

simonaubertbd avatar Jun 18 '22 08:06 simonaubertbd