From 071d1f3c19a75e268da2d00ffa457c8be710d875 Mon Sep 17 00:00:00 2001 From: LordHepipud Date: Thu, 6 Dec 2018 18:40:13 +0100 Subject: [PATCH] Added documentation for Execution Policies Fixes #4 stating steps on how to make the module run on Windows Hosts which restrict running PowerShell scripts/modules --- README.md | 1 + doc/03-ExecutionPolicy.md | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 doc/03-ExecutionPolicy.md diff --git a/README.md b/README.md index 8e6e31f..b1a1d98 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Please take a look on the following content to get to know the possibilities of * [Introduction](doc/01-Introduction.md) * [Installation Guide](doc/02-Installation.md) +* [Execution Policies](doc/03-ExecutionPolicy.md) Contributing ------------ diff --git a/doc/03-ExecutionPolicy.md b/doc/03-ExecutionPolicy.md new file mode 100644 index 0000000..2775ea0 --- /dev/null +++ b/doc/03-ExecutionPolicy.md @@ -0,0 +1,12 @@ +Setting Execution Policies +===================================== + +In order to be able to run the module on certain Windows Hosts, it might be required to either update the execution policies and/or unblock the module script files. + +The prefered way is to simply unblock the script files, allowing them to be executed on the system. This can be done by running a PowerShell instance as **Administrator** and enter the following command (we assume the module is installed at `C:\Program Files\WindowsPowershell\Modules\icinga-module-windows`. If not, please modify the command with the correct location) + +```powershell + Get-ChildItem -Path 'C:\Program Files\WindowsPowershell\Modules\icinga-module-windows' -Recurse | Unblock-File +``` + +Once done, please try again if you are now able to run the module on your host. If you are still not able to run the module and/or its scripts, please have a look on the Microsoft documentation for the [Set-Execution-Policy](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-6) Cmdlet to modify the Execution Policy for running PowerShell modules on your host, matching your internal guidelines. \ No newline at end of file