From 345ce424c60573463e54f5964be2b3c52b2bf16d Mon Sep 17 00:00:00 2001 From: = Date: Wed, 7 Oct 2015 06:24:37 +0100 Subject: [PATCH] Explictly set the version of strict mode to use for powershell modules. --- docsite/rst/developing_modules.rst | 2 +- lib/ansible/module_utils/powershell.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docsite/rst/developing_modules.rst b/docsite/rst/developing_modules.rst index 36c8283846..26a1019313 100644 --- a/docsite/rst/developing_modules.rst +++ b/docsite/rst/developing_modules.rst @@ -509,7 +509,7 @@ Windows modules checklist * Favour native powershell and .net ways of doing things over calls to COM libraries or calls to native executables which may or may not be present in all versions of windows * modules are in powershell (.ps1 files) but the docs reside in same name python file (.py) * look at ansible/lib/ansible/module_utils/powershell.ps1 for common code, avoid duplication -* Ansible uses strictmode so be sure to test with that enabled +* Ansible uses strictmode version 2.0 so be sure to test with that enabled * start with:: #!powershell diff --git a/lib/ansible/module_utils/powershell.ps1 b/lib/ansible/module_utils/powershell.ps1 index 58e121b95a..c150b07744 100644 --- a/lib/ansible/module_utils/powershell.ps1 +++ b/lib/ansible/module_utils/powershell.ps1 @@ -26,7 +26,7 @@ # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -Set-StrictMode -Version Latest +Set-StrictMode -Version 2.0 # Ansible v2 will insert the module arguments below as a string containing # JSON; assign them to an environment variable and redefine $args so existing