Windows modules: Add -type "path" to path parameters (#20282)

This PR is based on #20164 functionality to specify the parameter type
(e.g. as done for python modules).

In this case only -type "path" has a specific meaning, as it will expand
environment variables for paths. Which is typically done on Windows.

So you can do:

  - win_copy:
      src: files/some.doc
      dest: '%UserProfile%\My Documents'
This commit is contained in:
Dag Wieers 2017-01-16 20:39:58 +01:00 committed by Matt Davis
commit 7be39ca553
11 changed files with 22 additions and 22 deletions

View file

@ -25,9 +25,9 @@ $ErrorActionPreference = "Stop"
$parsed_args = Parse-Args $args $false
$raw_command_line = $(Get-AnsibleParam $parsed_args "_raw_params" -failifempty $true).Trim()
$chdir = Get-AnsibleParam $parsed_args "chdir"
$creates = Get-AnsibleParam $parsed_args "creates"
$removes = Get-AnsibleParam $parsed_args "removes"
$chdir = Get-AnsibleParam $parsed_args "chdir" -type "path"
$creates = Get-AnsibleParam $parsed_args "creates" -type "path"
$removes = Get-AnsibleParam $parsed_args "removes" -type "path"
$result = @{changed=$true; warnings=@(); cmd=$raw_command_line}