win_ping: Make full-functional

Small cleanup and backport `ping` functionality.
This commit is contained in:
Dag Wieers 2017-01-27 16:30:51 +01:00 committed by Matt Clay
commit a60c051952
2 changed files with 16 additions and 8 deletions

View file

@ -17,13 +17,19 @@
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args $args $true;
$ErrorActionPreference = "Stop"
$data = Get-Attr $params "data" "pong";
$params = Parse-Args $args -supports_check_mode $true
$result = New-Object psobject @{
$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;
Exit-Json $result