Skip to content

Commit

Permalink
Merge pull request ansible#12657 from jhawkesworth/powershell_strict_…
Browse files Browse the repository at this point in the history
…mode_version_2

Explictly set the version of strict mode to use for powershell modules.
  • Loading branch information
jimi-c committed Oct 7, 2015
2 parents 13184a0 + 345ce42 commit fb0294b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docsite/rst/developing_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/ansible/module_utils/powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb0294b

Please sign in to comment.