mirror of https://github.com/ansible/ansible.git
Add shared functions to module_utils/powershell.ps1 and refactor powershell modules to utilize the common powershell code
parent
3b5c568b10
commit
4268cb6a2d
@ -1,13 +1,11 @@
|
||||
#!powershell
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
|
||||
If ($args.Length -gt 0)
|
||||
{
|
||||
$params = Get-Content $args[0] | ConvertFrom-Json;
|
||||
}
|
||||
$params = Parse-Args $args;
|
||||
|
||||
$data = 'FIXME';
|
||||
|
||||
$result = New-Object psobject;
|
||||
$result | Add-Member -MemberType NoteProperty -Name fixme -Value $data;
|
||||
Set-Attr $result "fixme" $data;
|
||||
echo $result | ConvertTo-Json;
|
||||
|
@ -1,13 +1,11 @@
|
||||
#!powershell
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
|
||||
If ($args.Length -gt 0)
|
||||
{
|
||||
$params = Get-Content $args[0] | ConvertFrom-Json;
|
||||
}
|
||||
$params = Parse-Args $args;
|
||||
|
||||
$data = 'FIXME';
|
||||
|
||||
$result = New-Object psobject;
|
||||
$result | Add-Member -MemberType NoteProperty -Name fixme -Value $data;
|
||||
Set-Attr $result "fixme" $data;
|
||||
echo $result | ConvertTo-Json;
|
||||
|
@ -1,13 +1,11 @@
|
||||
#!powershell
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
|
||||
If ($args.Length -gt 0)
|
||||
{
|
||||
$params = Get-Content $args[0] | ConvertFrom-Json;
|
||||
}
|
||||
$params = Parse-Args $args;
|
||||
|
||||
$data = 'FIXME';
|
||||
|
||||
$result = New-Object psobject;
|
||||
$result | Add-Member -MemberType NoteProperty -Name fixme -Value $data;
|
||||
Set-Attr $result "fixme" $data;
|
||||
echo $result | ConvertTo-Json;
|
||||
|
@ -1,13 +1,11 @@
|
||||
#!powershell
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
|
||||
If ($args.Length -gt 0)
|
||||
{
|
||||
$params = Get-Content $args[0] | ConvertFrom-Json;
|
||||
}
|
||||
$params = Parse-Args $args;
|
||||
|
||||
$data = 'FIXME';
|
||||
|
||||
$result = New-Object psobject;
|
||||
$result | Add-Member -MemberType NoteProperty -Name fixme -Value $data;
|
||||
Set-Attr $result "fixme" $data;
|
||||
echo $result | ConvertTo-Json;
|
||||
|
@ -1,13 +1,11 @@
|
||||
#!powershell
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
|
||||
If ($args.Length -gt 0)
|
||||
{
|
||||
$params = Get-Content $args[0] | ConvertFrom-Json;
|
||||
}
|
||||
$params = Parse-Args $args;
|
||||
|
||||
$data = 'FIXME';
|
||||
|
||||
$result = New-Object psobject;
|
||||
$result | Add-Member -MemberType NoteProperty -Name fixme -Value $data;
|
||||
Set-Attr $result "fixme" $data;
|
||||
echo $result | ConvertTo-Json;
|
||||
|
@ -1,87 +0,0 @@
|
||||
#!powershell
|
||||
# WANT_JSON
|
||||
|
||||
If ($args.Length -gt 0)
|
||||
{
|
||||
$params = Get-Content $args[0] | ConvertFrom-Json;
|
||||
}
|
||||
|
||||
$data = 'pong';
|
||||
If ($params.data.GetType)
|
||||
{
|
||||
$data = $params.data;
|
||||
}
|
||||
|
||||
$result = New-Object psobject;
|
||||
$result | Add-Member -MemberType NoteProperty -Name ping -Value $data;
|
||||
echo $result | ConvertTo-Json;
|
||||
|
||||
# _______ _ _
|
||||
# |__ __| | (_)
|
||||
# | | | |__ _ ___
|
||||
# | | | '_ \| / __|
|
||||
# | | | | | | \__ \
|
||||
# __|_| |_| |_|_|___/
|
||||
# |_ _|
|
||||
# | | ___
|
||||
# | | / __|
|
||||
# _| |_\__ \
|
||||
# |___/\|___/
|
||||
# / \
|
||||
# / /\ \
|
||||
# / ____ \
|
||||
# /_/ \_\
|
||||
# | |
|
||||
# | | __ _ _ __ __ _ ___
|
||||
# | | / _` | '__/ _` |/ _ \
|
||||
# | |___| (_| | | | (_| | __/
|
||||
# |______\__,_|_| \__, |\___|
|
||||
# __/ |
|
||||
# ____ _ |___/
|
||||
# | _ \| | | |
|
||||
# | |_) | | ___ ___| | __
|
||||
# | _ <| |/ _ \ / __| |/ /
|
||||
# | |_) | | (_) | (__| <
|
||||
# |____/|_|\___/ \___|_|\_\
|
||||
# / __ \ / _|
|
||||
# | | | | |_
|
||||
# | | | | _|
|
||||
# | |__| | |
|
||||
# \____/|_| __ __
|
||||
# / ____| | / _|/ _|
|
||||
# | (___ | |_ _ _| |_| |_
|
||||
# \___ \| __| | | | _| _|
|
||||
# ____) | |_| |_| | | | |
|
||||
# |_____/ \__|\__,_|_| |_|
|
||||
# | | | |
|
||||
# | |_ _ ___| |_
|
||||
# _ | | | | / __| __|
|
||||
# | |__| | |_| \__ \ |_
|
||||
# \____/_\__,_|___/\__|
|
||||
# |__ __|
|
||||
# | | ___
|
||||
# | |/ _ \
|
||||
# | | (_) |
|
||||
# __|_|\___/ _
|
||||
# | \/ | | |
|
||||
# | \ / | __ _| | _____
|
||||
# | |\/| |/ _` | |/ / _ \
|
||||
# | | | | (_| | < __/
|
||||
# |_|__|_|\__,_|_|\_\___|
|
||||
# |__ __| |
|
||||
# | | | |__ ___
|
||||
# | | | '_ \ / _ \
|
||||
# | | | | | | __/
|
||||
# __|_|_ |_| |_|\___|
|
||||
# | ____(_) |
|
||||
# | |__ _| | ___
|
||||
# | __| | | |/ _ \
|
||||
# | | | | | __/
|
||||
# |_|__ |_|_|\___|
|
||||
# | _ \(_)
|
||||
# | |_) |_ __ _ __ _ ___ _ __
|
||||
# | _ <| |/ _` |/ _` |/ _ \ '__|
|
||||
# | |_) | | (_| | (_| | __/ |
|
||||
# |____/|_|\__, |\__, |\___|_|
|
||||
# __/ | __/ |
|
||||
# |___/ |___/
|
@ -0,0 +1,15 @@
|
||||
#!powershell
|
||||
# WANT_JSON
|
||||
# POWERSHELL_COMMON
|
||||
|
||||
$params = Parse-Args $args;
|
||||
|
||||
$data = 'pong';
|
||||
If ($params.data.GetType)
|
||||
{
|
||||
$data = $params.data;
|
||||
}
|
||||
|
||||
$result = New-Object psobject;
|
||||
Set-Attr $result "ping" $data;
|
||||
echo $result | ConvertTo-Json;
|
Loading…
Reference in New Issue