From 8e8590c962ffcd8c6f3f0cf0512a52353643afa1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Tue, 24 Aug 2021 22:36:16 +0200 Subject: [PATCH] Adding some more verbose logging --- Public/Invoke-O365Admin.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Public/Invoke-O365Admin.ps1 b/Public/Invoke-O365Admin.ps1 index e24473af8..305808bd1 100644 --- a/Public/Invoke-O365Admin.ps1 +++ b/Public/Invoke-O365Admin.ps1 @@ -47,9 +47,9 @@ $RestSplat['Body'] = $Body | ConvertTo-Json -Depth 5 } $RestSplat.Uri = $Uri + $WhatIfInformation = "Invoking [$Method] " + [System.Environment]::NewLine + $RestSplat['Body'] + [System.Environment]::NewLine try { - Write-Verbose "Invoke-O365Admin - Querying [$Method] $($RestSplat.Uri)" - $WhatIfInformation = "Invoking [$Method] " + [System.Environment]::NewLine + $RestSplat['Body'] + [System.Environment]::NewLine + Write-Verbose "Invoke-O365Admin - $($WhatIfInformation)over URI $($RestSplat.Uri)" if ($Method -eq 'GET') { # We use separate check because WHATIF would sometimes trigger when GET was used inside a SET $OutputQuery = Invoke-RestMethod @RestSplat -Verbose:$false