From bb5dadf4db49663f138c200ab6cd2031fe8c6430 Mon Sep 17 00:00:00 2001 From: Mike Kassis Date: Thu, 9 Nov 2017 12:06:49 -0800 Subject: [PATCH] Reverting --- Azure-Security-Center.psd1 | 2 +- Azure-Security-Center.psm1 | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Azure-Security-Center.psd1 b/Azure-Security-Center.psd1 index e84bd20..0bab803 100644 --- a/Azure-Security-Center.psd1 +++ b/Azure-Security-Center.psd1 @@ -12,7 +12,7 @@ RootModule = 'Azure-Security-Center.psm1' # Version number of this module. -ModuleVersion = '0.0.16' +ModuleVersion = '0.0.17' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/Azure-Security-Center.psm1 b/Azure-Security-Center.psm1 index a5f8785..cb00a5e 100644 --- a/Azure-Security-Center.psm1 +++ b/Azure-Security-Center.psm1 @@ -523,7 +523,7 @@ function Get-ASCPolicy { } } - Else { + If ($PolicyName -and !$Baseline) { $asc_uri = "https://$asc_url/subscriptions/$asc_subscriptionId/providers/microsoft.Security/$asc_endpoint/$PolicyName$asc_APIVersion" Try { Write-Verbose "Retrieving data for $PolicyName..." @@ -536,6 +536,19 @@ function Get-ASCPolicy { $asc_request } } + If ($PolicyName -and $Baseline) { + $asc_uri = "https://$asc_url/subscriptions/$asc_subscriptionId/providers/microsoft.Security/$asc_endpoint/$PolicyName/baselineConfigurations$asc_APIVersion" + Try { + Write-Verbose "Retrieving data for $PolicyName..." + $asc_request = Invoke-RestMethod -Uri $asc_uri -Method Get -Headers $asc_requestHeader + } + Catch { + Write-Error $_ + } + Finally { + $asc_request + } + } } End { }