diff --git a/Tools.ps1 b/Tools.ps1 index 401c446..3ad93d3 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -149,9 +149,14 @@ Function Run-Script { } } } + + $LogFileContent = (Get-Content $LogFile) + ## Write the log file output to the console - If ( Test-Path $LogFile ) { Get-Content -Path $LogFile | Write-Output } - Else { Write-Output "Log file not found at ""$LogFile""" } + If ( $LogFileContent ) { Write-Output $LogFileContent } + + ## Delete the log file if it's empty + Else { Remove-Item $LogFile -Force } } ## Return a Powershell version object from a string