Add Exit-Json and Fail-Json powershell helper functions

This commit is contained in:
Matt Martz 2014-06-18 11:48:50 -05:00
parent 57f43ae518
commit b0ef377a09
4 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -44,4 +44,4 @@ $result = New-Object psobject @{
encoding = "base64"
};
Set-Attr $result "content" $content;
echo $result | ConvertTo-Json;
Exit-Json $result;

View file

@ -29,4 +29,4 @@ $result = New-Object psobject @{
changed = $false
ping = $data
};
echo $result | ConvertTo-Json;
Exit-Json $result;

View file

@ -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;