Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Diagnostics/AVTester/Test-ExchAVExclusions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Just update script version to latest one.

.OUTPUTS
Log file:
$PSScriptRoot\Test-ExchAvExclusions-#DataTime#.txt
$PSScriptRoot\Test-ExchAvExclusions-#ServerName#-#DataTime#.txt

List of Scanned Folders:
$PSScriptRoot\BadExclusions-#DataTime#.txt
$PSScriptRoot\BadExclusions-#ServerName#-#DataTime#.txt
Comment on lines 48 to +52

.EXAMPLE
.\Test-ExchAVExclusions.ps1
Expand Down Expand Up @@ -101,7 +101,7 @@ function Write-HostLog ($message) {
}
}

$LogFileName = "Test-ExchAvExclusions"
$LogFileName = "Test-ExchAvExclusions-$env:COMPUTERNAME"
$StartDate = Get-Date
$StartDateFormatted = ($StartDate).ToString("yyyyMMddhhmmss")
$Script:DebugLogger = Get-NewLoggerInstance -LogName "$LogFileName-Debug-$StartDateFormatted" -LogDirectory $PSScriptRoot -AppendDateTimeToFileName $false -ErrorAction SilentlyContinue
Expand All @@ -114,7 +114,7 @@ SetWriteWarningAction ${Function:Write-HostLog}

$BuildVersion = ""

Write-Host ("Test-ExchAVExclusions.ps1 script version $($BuildVersion)") -ForegroundColor Green
Write-Host ("Test-ExchAVExclusions.ps1 script version $($BuildVersion) on server $env:COMPUTERNAME") -ForegroundColor Green

if ($ScriptUpdateOnly) {
switch (Test-ScriptVersion -AutoUpdate -VersionsUrl "https://aka.ms/Test-ExchAVExclusions-VersionsURL" -Confirm:$false) {
Expand Down Expand Up @@ -605,9 +605,9 @@ foreach ($extension in $extensionsList) {
#Delete Random Folder
Remove-Item $randomFolder -Confirm:$false -Force -Recurse

$OutputPath = Join-Path $PSScriptRoot BadExclusions-$StartDateFormatted.txt
$OutputPath = Join-Path $PSScriptRoot "BadExclusions-$env:COMPUTERNAME-$StartDateFormatted.txt"
"###########################################################################################" | Out-File $OutputPath
"Exclusions analysis at $((Get-Date).ToString())" | Out-File $OutputPath -Append
"Exclusions analysis on server $env:COMPUTERNAME at $((Get-Date).ToString())" | Out-File $OutputPath -Append
"###########################################################################################" | Out-File $OutputPath -Append

# Report what we found
Expand Down
4 changes: 2 additions & 2 deletions docs/Diagnostics/Test-ExchAVExclusions.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ScriptUpdateOnly | Just update script version to latest one.
## Outputs

Log file:
$PSScriptRoot\Test-ExchAvExclusions-#DateTime#.txt
$PSScriptRoot\Test-ExchAvExclusions-#ServerName#-#DateTime#.txt

List of Folders, extensions Scanned by AV and List of Non-Default Processes:
$PSScriptRoot\BadExclusions-#DateTime#.txt
$PSScriptRoot\BadExclusions-#ServerName#-#DateTime#.txt
Comment on lines 63 to +67