From 63b13fdac6b9e00046f4681b298b8a58c845c6bc Mon Sep 17 00:00:00 2001 From: JnaneshD05 <97098752+JnaneshD05@users.noreply.github.com> Date: Tue, 1 Nov 2022 16:49:28 +0530 Subject: [PATCH 1/2] Changing the StoragePolicy Url to V2 --- Modules/Commvault.Policies/Commvault.Policies.psm1 | 4 ++-- Modules/Commvault.RESTSession/Commvault.RESTSession.psm1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Commvault.Policies/Commvault.Policies.psm1 b/Modules/Commvault.Policies/Commvault.Policies.psm1 index 29d8691..f18d63b 100644 --- a/Modules/Commvault.Policies/Commvault.Policies.psm1 +++ b/Modules/Commvault.Policies/Commvault.Policies.psm1 @@ -628,7 +628,7 @@ function Get-CVStoragePolicy { else { foreach ($policy in $response.Content.policies) { if (-not [String]::IsNullOrEmpty($Name)) { - if ($Name -eq $policy.storagePolicyName) { + if ($Name -eq $policy.storagePolicy.storagePolicyName) { $policiesToProcess += $policy } } @@ -645,7 +645,7 @@ function Get-CVStoragePolicy { $sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{storagePolicyId}', $policy.storagePolicyAndCopy.storagePolicyId) } else { - $sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{storagePolicyId}', $policy.storagePolicyId) + $sessionObj.requestProps.endpoint = $sessionObj.requestProps.endpoint -creplace ('{storagePolicyId}', $policy.storagePolicy.storagePolicyId) } $headerObj = Get-CVRESTHeader $sessionObj diff --git a/Modules/Commvault.RESTSession/Commvault.RESTSession.psm1 b/Modules/Commvault.RESTSession/Commvault.RESTSession.psm1 index af524cf..ec308e8 100644 --- a/Modules/Commvault.RESTSession/Commvault.RESTSession.psm1 +++ b/Modules/Commvault.RESTSession/Commvault.RESTSession.psm1 @@ -954,7 +954,7 @@ function GetAPIDetail ([String] $Request) { 'Get-CVStoragePolicy' = @{ Description = 'Get storage policies' - Endpoint = 'StoragePolicy' + Endpoint = 'V2/StoragePolicy' Method = 'Get' Body = '' } From 8958e9e48c996c2378a41e647ad3e85ec6165cb0 Mon Sep 17 00:00:00 2001 From: JnaneshD05 <97098752+JnaneshD05@users.noreply.github.com> Date: Mon, 2 Jan 2023 20:25:48 +0530 Subject: [PATCH 2/2] Show DR backups in the Get-CVJob command --- Modules/Commvault.JobManager/Commvault.JobManager.psm1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/Commvault.JobManager/Commvault.JobManager.psm1 b/Modules/Commvault.JobManager/Commvault.JobManager.psm1 index 53b8ea9..95ed377 100644 --- a/Modules/Commvault.JobManager/Commvault.JobManager.psm1 +++ b/Modules/Commvault.JobManager/Commvault.JobManager.psm1 @@ -199,7 +199,9 @@ function Get-CVJob { $subclientId = $subclientObj.subclientId } } - + + $sessionObj.requestProps.endpoint += "&hideAdminjobs=false" + if (-not [String]::IsNullOrEmpty($JobFilter)) { $sessionObj.requestProps.endpoint += '&jobFilter=' + $JobFilter }