Skip to content

Commit

Permalink
fix: get and create tasks
Browse files Browse the repository at this point in the history
  - Fix #148 remove ID parameter from Get-QlikTask
  - Fix assigning properties and tags when creating tasks
  • Loading branch information
ahaydon committed Aug 24, 2021
1 parent 3124528 commit 83b3cd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions resources/task.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ function Get-QlikReloadTask {
function Get-QlikTask {
[CmdletBinding()]
param (
[parameter(Position = 0)]
[string]$id,
[string]$filter,
[switch]$full,
[switch]$raw
Expand Down Expand Up @@ -167,8 +165,8 @@ function New-QlikTask {
};
}

if ($PSBoundParameters.ContainsKey("customProperties")) { $task.customProperties = @(GetCustomProperties $customProperties) }
if ($PSBoundParameters.ContainsKey("tags")) { $task.tags = @(GetTags $tags) }
if ($PSBoundParameters.ContainsKey("customProperties")) { $task.task.customProperties = @(GetCustomProperties $customProperties) }
if ($PSBoundParameters.ContainsKey("tags")) { $task.task.tags = @(GetTags $tags) }

$json = $task | ConvertTo-Json -Compress -Depth 10

Expand Down
4 changes: 2 additions & 2 deletions tests/task.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Describe "New-QlikTask" {
-customProperties 'environment=development'

$task.task.name | Should Be 'Reload App'
$task.task.tags | Should -HaveCount 1
$task.task.tags.Count | Should -BeExactly 1
$task.task.app.id | Should Be '982a578f-d335-4e4f-81be-c031e6acb780'
$task.task.customProperties | Should -HaveCount 1
$task.task.customProperties.Count | Should -BeExactly 1

Assert-VerifiableMock
}
Expand Down

0 comments on commit 83b3cd9

Please sign in to comment.