From f0b981f380186cfc21e30da820d90a5bc0cd2b52 Mon Sep 17 00:00:00 2001 From: Jiri Formacek Date: Mon, 29 Jul 2024 02:36:38 +0200 Subject: [PATCH] updated logging --- Module/ExoHelper/ExoHelper.psd1 | 2 +- Module/ExoHelper/ExoHelper.psm1 | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Module/ExoHelper/ExoHelper.psd1 b/Module/ExoHelper/ExoHelper.psd1 index 346a2ea..0a2d7e1 100644 --- a/Module/ExoHelper/ExoHelper.psd1 +++ b/Module/ExoHelper/ExoHelper.psd1 @@ -110,7 +110,7 @@ PrivateData = @{ # ReleaseNotes = '' # Prerelease string of this module - Prerelease = 'beta2' + Prerelease = 'beta3' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false diff --git a/Module/ExoHelper/ExoHelper.psm1 b/Module/ExoHelper/ExoHelper.psm1 index 6d914c0..d6940f8 100644 --- a/Module/ExoHelper/ExoHelper.psm1 +++ b/Module/ExoHelper/ExoHelper.psm1 @@ -205,6 +205,12 @@ This command creates connection for IPPS REST API, retrieves list of sensitivity #1000 is a minimum, and min increment is 1000 $ResultSize = [int]::MaxValue, + [Parameter()] + [int] + #Max results to return in single request + #Default is 100 + $PageSize = 100, + [switch] #If we want to write any warnings returned by EXO REST API $ShowWarnings, @@ -227,7 +233,16 @@ This command creates connection for IPPS REST API, retrieves list of sensitivity begin { $body = @{} - $batchSize = 100 + if($PageSize -gt 1000) + { + $batchSize = 1000 + } + if($PageSize -le 0) + { + $batchSize = 100 + } + $batchSize = $pageSize + $uri = $Connection.ConnectionUri if($PropertiesToLoad.Count -gt 0) { @@ -271,7 +286,7 @@ This command creates connection for IPPS REST API, retrieves list of sensitivity $headers['client-request-id'] = [Guid]::NewGuid().ToString() #provide up to date token for each request of commands returning paged results that may take long to complete $headers['Authorization'] = (Get-ExoToken -Connection $Connection).CreateAuthorizationHeader() - Write-Verbose "RequestId: $($headers['client-request-id'])`tUri: $pageUri" + Write-Verbose "$([DateTime]::UtcNow.ToString('o'))`tResults:$resultsRetrieved`tRequestId: $($headers['client-request-id'])`tUri: $pageUri" $splat = @{ Uri = $pageUri Method = 'Post'