From 9d1357309bf963bf78b5e5f2fd70501ec8a736ca Mon Sep 17 00:00:00 2001 From: David Paulson Date: Fri, 25 Oct 2024 14:47:44 -0500 Subject: [PATCH] Remove Confirm-Administrator from Gen Logging --- .../ConfigureFipFsTextExtractionOverrides.ps1 | 7 +++++++ Shared/GenericScriptStartLogging.ps1 | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Security/src/ConfigureFipFsTextExtractionOverrides/ConfigureFipFsTextExtractionOverrides.ps1 b/Security/src/ConfigureFipFsTextExtractionOverrides/ConfigureFipFsTextExtractionOverrides.ps1 index d50592bf96..5a3e3c019d 100644 --- a/Security/src/ConfigureFipFsTextExtractionOverrides/ConfigureFipFsTextExtractionOverrides.ps1 +++ b/Security/src/ConfigureFipFsTextExtractionOverrides/ConfigureFipFsTextExtractionOverrides.ps1 @@ -88,9 +88,16 @@ begin { . $PSScriptRoot\ConfigurationAction\Invoke-TextExtractionOverride.ps1 . $PSScriptRoot\..\Shared\Get-ProcessedServerList.ps1 . $PSScriptRoot\..\..\..\Shared\Confirm-ExchangeManagementShell.ps1 + . $PSScriptRoot\..\..\..\Shared\Confirm-Administrator.ps1 . $PSScriptRoot\..\..\..\Shared\GenericScriptStartLogging.ps1 + . $PSScriptRoot\..\..\..\Shared\Show-Disclaimer.ps1 . $PSScriptRoot\..\..\..\Shared\ScriptUpdateFunctions\GenericScriptUpdate.ps1 + if (-not(Confirm-Administrator)) { + Write-Host "The script needs to be executed in elevated mode. Start the PowerShell as an administrator." -ForegroundColor Yellow + exit + } + $includeExchangeServerNames = New-Object System.Collections.Generic.List[string] } process { foreach ($server in $ExchangeServerNames) { diff --git a/Shared/GenericScriptStartLogging.ps1 b/Shared/GenericScriptStartLogging.ps1 index 3ee99b3871..0cff7967d6 100644 --- a/Shared/GenericScriptStartLogging.ps1 +++ b/Shared/GenericScriptStartLogging.ps1 @@ -9,9 +9,7 @@ . $PSScriptRoot\OutputOverrides\Write-Progress.ps1 . $PSScriptRoot\OutputOverrides\Write-Verbose.ps1 . $PSScriptRoot\OutputOverrides\Write-Warning.ps1 -. $PSScriptRoot\Confirm-Administrator.ps1 . $PSScriptRoot\LoggerFunctions.ps1 -. $PSScriptRoot\Show-Disclaimer.ps1 function Write-DebugLog ($Message) { $Script:DebugLogger = $Script:DebugLogger | Write-LoggerInstance $Message @@ -41,8 +39,3 @@ if ($Script:DualLoggingEnabled) { } else { SetWriteHostAction ${Write-DebugLog} } - -if (-not(Confirm-Administrator)) { - Write-Host "The script needs to be executed in elevated mode. Start the PowerShell as an administrator." -ForegroundColor Yellow - exit -}