mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
17 lines
370 B
PowerShell
17 lines
370 B
PowerShell
#!powershell
|
|
# WANT_JSON
|
|
|
|
If ($args.Length -gt 0)
|
|
{
|
|
$params = Get-Content $args[0] | ConvertFrom-Json;
|
|
}
|
|
|
|
$data = 'pong';
|
|
If (($params | Get-Member | Select-Object -ExpandProperty Name) -contains 'data')
|
|
{
|
|
$data = $params.data;
|
|
}
|
|
|
|
$result = New-Object psobject;
|
|
$result | Add-Member -MemberType NoteProperty -Name ping -Value $data;
|
|
echo $result | ConvertTo-Json;
|