From f6f6acf9fc73104b614a6a266d15d6424442ab76 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sun, 3 Nov 2019 15:55:08 +0100 Subject: [PATCH] Add function to recursively unblock PowerShell files --- .../framework/Unblock-IcingaPowerShellFiles.psm1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/core/framework/Unblock-IcingaPowerShellFiles.psm1 diff --git a/lib/core/framework/Unblock-IcingaPowerShellFiles.psm1 b/lib/core/framework/Unblock-IcingaPowerShellFiles.psm1 new file mode 100644 index 0000000..9f6ef5c --- /dev/null +++ b/lib/core/framework/Unblock-IcingaPowerShellFiles.psm1 @@ -0,0 +1,14 @@ +function Unblock-IcingaPowerShellFiles() +{ + param( + $Path + ); + + if ([string]::IsNullOrEmpty($Path)) { + Write-Host 'The specified directory was not found'; + return; + } + + Write-Host 'Unblocking Icinga PowerShell Files'; + Get-ChildItem -Path $Path -Recurse | Unblock-File; +}