Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simonaubertbd opened this issue Jun 18, 2022 · 0 comments
Open

Comments

@simonaubertbd
Copy link

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
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant