95a1170908
* Windows: Add special parameter types Adding explicit parameter types now exposes this information in the module documentation, and proves really helpful. We only do this for non-string types as strings, mostly because strings are implicit. PS We also make copyright statements consistent and use #Requires for explicit library imports * Type "string" must be type "str" * A few more Copyright corrections * More fixes * Don't add file encoding to Powershell files * Don't add missing interfacetypes parameter Otherwise CI demands an incorrect version_added * Small fix
22 lines
439 B
PowerShell
22 lines
439 B
PowerShell
#!powershell
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
#Requires -Module Ansible.ModuleUtils.Legacy
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$params = Parse-Args $args -supports_check_mode $true
|
|
|
|
$data = Get-AnsibleParam -obj $params -name "data" -type "str" -default "pong"
|
|
|
|
if ($data -eq "crash") {
|
|
throw "boom"
|
|
}
|
|
|
|
$result = @{
|
|
changed = $false
|
|
ping = $data
|
|
}
|
|
|
|
Exit-Json $result
|