From 40ab5191dea082e17fae65a65d4217474f0ffe7d Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 3 Aug 2020 14:58:50 +0200 Subject: [PATCH] Fixes Icinga shell header being printed when it shouldn't Impelements #87 --- icinga-powershell-framework.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icinga-powershell-framework.psm1 b/icinga-powershell-framework.psm1 index 2b1dee3..f4b22c2 100644 --- a/icinga-powershell-framework.psm1 +++ b/icinga-powershell-framework.psm1 @@ -276,7 +276,7 @@ function Invoke-IcingaCommand() # Print a header informing our user that loaded the Icinga Framework with a specific # version. We can also skip the header by using $SKipHeader - if ($SkipHeader -eq $FALSE) { + if ([string]::IsNullOrEmpty($ScriptBlock) -And $SkipHeader -eq $FALSE) { Write-Host '******************************************************'; Write-Host ([string]::Format('** Icinga PowerShell Framework {0}', $IcingaFrameworkData.PrivateData.Version)); Write-Host ([string]::Format('** Copyright {0}', $IcingaFrameworkData.Copyright));