Skip to content

Commit

Permalink
Merge pull request #2213 from microsoft/dpaul-ScriptLogging
Browse files Browse the repository at this point in the history
Remove Confirm-Administrator from Gen Logging
  • Loading branch information
dpaulson45 authored Oct 29, 2024
2 parents a6be221 + 9d13573 commit 6d715ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 0 additions & 7 deletions Shared/GenericScriptStartLogging.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 6d715ca

Please sign in to comment.