Add Exit-Json and Fail-Json powershell helper functions
This commit is contained in:
parent
57f43ae518
commit
b0ef377a09
4 changed files with 4 additions and 4 deletions
|
@ -34,4 +34,4 @@ Set-Attr $result.ansible_facts "ansible_os_family" "Windows"
|
|||
Set-Attr $result.ansible_facts "ansible_distribution" $osversion.VersionString
|
||||
Set-Attr $result.ansible_facts "ansible_distribution_version" $osversion.Version.ToString()
|
||||
|
||||
echo $result | ConvertTo-Json;
|
||||
Exit-Json $result;
|
||||
|
|
|
@ -44,4 +44,4 @@ $result = New-Object psobject @{
|
|||
encoding = "base64"
|
||||
};
|
||||
Set-Attr $result "content" $content;
|
||||
echo $result | ConvertTo-Json;
|
||||
Exit-Json $result;
|
||||
|
|
|
@ -29,4 +29,4 @@ $result = New-Object psobject @{
|
|||
changed = $false
|
||||
ping = $data
|
||||
};
|
||||
echo $result | ConvertTo-Json;
|
||||
Exit-Json $result;
|
||||
|
|
|
@ -61,4 +61,4 @@ If ($get_md5 -and $result.stat.exists -and -not $result.stat.isdir)
|
|||
Set-Attr $result.stat "md5" $path_md5;
|
||||
}
|
||||
|
||||
echo $result | ConvertTo-Json;
|
||||
Exit-Json $result;
|
||||
|
|
Loading…
Reference in a new issue