mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add Exit-Json and Fail-Json powershell helper functions
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user