mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
win_ping: Make full-functional
Small cleanup and backport `ping` functionality.
This commit is contained in:
parent
4d57515aec
commit
a60c051952
2 changed files with 16 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue