From 5832f46d4316251ea2e68062af592a06574dd6ae Mon Sep 17 00:00:00 2001 From: Michael O''Toole Date: Fri, 28 Oct 2022 20:12:50 +0100 Subject: [PATCH] v1.6.1 - Bugfix for Jobs endpoint. --- NinjaOne.psd1 | 4 ++-- Private/New-NinjaOneGETRequest.ps1 | 2 +- Public/Get/Entities/Get-NinjaOneJobs.ps1 | 1 + Public/Get/Ticketing/Get-NinjaOneTicketLogEntries.ps1 | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NinjaOne.psd1 b/NinjaOne.psd1 index 0923332..153b173 100644 --- a/NinjaOne.psd1 +++ b/NinjaOne.psd1 @@ -12,7 +12,7 @@ RootModule = '.\NinjaOne.psm1' # Version number of this module. - ModuleVersion = '1.6.0' + ModuleVersion = '1.6.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -245,7 +245,7 @@ IconUri = 'https://pbs.twimg.com/profile_images/1452496768030187521/kIGQii5Y_400x400.jpg' # ReleaseNotes of this module - ReleaseNotes = 'Fix multiple parameters which were incorrect set as mandatoryowerShell implementation. Faster, easier and more maintainable.' + ReleaseNotes = 'Fix return value for Jobs endpoint.' # Prerelease string of this module # Prerelease = '' diff --git a/Private/New-NinjaOneGETRequest.ps1 b/Private/New-NinjaOneGETRequest.ps1 index f43912b..f02e424 100644 --- a/Private/New-NinjaOneGETRequest.ps1 +++ b/Private/New-NinjaOneGETRequest.ps1 @@ -59,7 +59,7 @@ function New-NinjaOneGETRequest { Write-Debug "Returning 'result' property." Write-Debug "Result type is $($Result.result.GetType())" Return $Result.result - } elseif ($Properties.name -contains 'data') { + } elseif (($Properties.name -contains 'data') -and (-not $NoDrill)) { Write-Debug "Returning 'data' property." Write-Debug "Result type is $($Result.data.GetType())" Return $Result.data diff --git a/Public/Get/Entities/Get-NinjaOneJobs.ps1 b/Public/Get/Entities/Get-NinjaOneJobs.ps1 index 8fdc611..378abf5 100644 --- a/Public/Get/Entities/Get-NinjaOneJobs.ps1 +++ b/Public/Get/Entities/Get-NinjaOneJobs.ps1 @@ -50,6 +50,7 @@ function Get-NinjaOneJobs { $RequestParams = @{ Resource = $Resource QSCollection = $QSCollection + NoDrill = $True } $JobResults = New-NinjaOneGETRequest @RequestParams Return $JobResults diff --git a/Public/Get/Ticketing/Get-NinjaOneTicketLogEntries.ps1 b/Public/Get/Ticketing/Get-NinjaOneTicketLogEntries.ps1 index cb30724..e30a6df 100644 --- a/Public/Get/Ticketing/Get-NinjaOneTicketLogEntries.ps1 +++ b/Public/Get/Ticketing/Get-NinjaOneTicketLogEntries.ps1 @@ -23,6 +23,10 @@ function Get-NinjaOneTicketLogEntries { ) $CommandName = $MyInvocation.InvocationName $Parameters = (Get-Command -Name $CommandName).Parameters + # Workaround to prevent the query string processor from adding an 'ticketid=' parameter by removing it from the set parameters. + if ($boardID) { + $Parameters.Remove('ticketID') | Out-Null + } try { $QSCollection = New-NinjaOneQuery -CommandName $CommandName -Parameters $Parameters $Resource = "v2/ticketing/ticket/$ticketID/log-entry"