mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
removed psobject to hashtables that were missed (#32710)
* removed psobject to hashtables that were missed * fix up win_region change
This commit is contained in:
parent
d21f32168f
commit
5e20fd0943
10 changed files with 29 additions and 29 deletions
|
@ -26,13 +26,13 @@ $params = Parse-Args $args;
|
||||||
# Name parameter
|
# Name parameter
|
||||||
$name = Get-Attr $params "name" $FALSE;
|
$name = Get-Attr $params "name" $FALSE;
|
||||||
If ($name -eq $FALSE) {
|
If ($name -eq $FALSE) {
|
||||||
Fail-Json (New-Object psobject) "missing required argument: name";
|
Fail-Json @{} "missing required argument: name";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Site
|
# Site
|
||||||
$site = Get-Attr $params "site" $FALSE;
|
$site = Get-Attr $params "site" $FALSE;
|
||||||
If ($site -eq $FALSE) {
|
If ($site -eq $FALSE) {
|
||||||
Fail-Json (New-Object psobject) "missing required argument: site";
|
Fail-Json @{} "missing required argument: site";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Application
|
# Application
|
||||||
|
@ -53,8 +53,8 @@ if ((Get-Module "WebAdministration" -ErrorAction SilentlyContinue) -eq $null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Result
|
# Result
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
directory = New-Object psobject
|
directory = @{}
|
||||||
changed = $false
|
changed = $false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,13 +76,13 @@ try {
|
||||||
# Add directory
|
# Add directory
|
||||||
If(($state -eq 'present') -and (-not $directory)) {
|
If(($state -eq 'present') -and (-not $directory)) {
|
||||||
If ($physical_path -eq $FALSE) {
|
If ($physical_path -eq $FALSE) {
|
||||||
Fail-Json (New-Object psobject) "missing required arguments: physical_path"
|
Fail-Json @{} "missing required arguments: physical_path"
|
||||||
}
|
}
|
||||||
If (-not (Test-Path $physical_path)) {
|
If (-not (Test-Path $physical_path)) {
|
||||||
Fail-Json (New-Object psobject) "specified folder must already exist: physical_path"
|
Fail-Json @{} "specified folder must already exist: physical_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
$directory_parameters = New-Object psobject @{
|
$directory_parameters = @{
|
||||||
Site = $site
|
Site = $site
|
||||||
Name = $name
|
Name = $name
|
||||||
PhysicalPath = $physical_path
|
PhysicalPath = $physical_path
|
||||||
|
@ -108,7 +108,7 @@ try {
|
||||||
# Change Physical Path if needed
|
# Change Physical Path if needed
|
||||||
if($physical_path) {
|
if($physical_path) {
|
||||||
If (-not (Test-Path $physical_path)) {
|
If (-not (Test-Path $physical_path)) {
|
||||||
Fail-Json (New-Object psobject) "specified folder must already exist: physical_path"
|
Fail-Json @{} "specified folder must already exist: physical_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
$vdir_folder = Get-Item $directory.PhysicalPath
|
$vdir_folder = Get-Item $directory.PhysicalPath
|
||||||
|
@ -125,7 +125,7 @@ try {
|
||||||
|
|
||||||
# Result
|
# Result
|
||||||
$directory = Get-WebVirtualDirectory -Site $site -Name $name
|
$directory = Get-WebVirtualDirectory -Site $site -Name $name
|
||||||
$result.directory = New-Object psobject @{
|
$result.directory = @{
|
||||||
PhysicalPath = $directory.PhysicalPath
|
PhysicalPath = $directory.PhysicalPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ $ip = Get-AnsibleParam $params -name "ip"
|
||||||
$certificatehash = Get-AnsibleParam $params -name "certificate_hash" -default $false
|
$certificatehash = Get-AnsibleParam $params -name "certificate_hash" -default $false
|
||||||
$certificateStoreName = Get-AnsibleParam $params -name "certificate_store_name" -default "MY"
|
$certificateStoreName = Get-AnsibleParam $params -name "certificate_store_name" -default "MY"
|
||||||
|
|
||||||
$binding_parameters = New-Object psobject @{
|
$binding_parameters = @{
|
||||||
Name = $name
|
Name = $name
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ if ((Get-Module "WebAdministration" -ErrorAction SilentlyContinue) -eq $null){
|
||||||
}
|
}
|
||||||
|
|
||||||
function Create-Binding-Info {
|
function Create-Binding-Info {
|
||||||
return New-Object psobject @{
|
return @{
|
||||||
"bindingInformation" = $args[0].bindingInformation
|
"bindingInformation" = $args[0].bindingInformation
|
||||||
"certificateHash" = $args[0].certificateHash
|
"certificateHash" = $args[0].certificateHash
|
||||||
"certificateStoreName" = $args[0].certificateStoreName
|
"certificateStoreName" = $args[0].certificateStoreName
|
||||||
|
@ -69,7 +69,7 @@ function Create-Binding-Info {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Result
|
# Result
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
changed = $false
|
changed = $false
|
||||||
parameters = $binding_parameters
|
parameters = $binding_parameters
|
||||||
matched = @()
|
matched = @()
|
||||||
|
|
|
@ -25,14 +25,14 @@ $params = Parse-Args $args;
|
||||||
# Name parameter
|
# Name parameter
|
||||||
$name = Get-Attr $params "name" $FALSE;
|
$name = Get-Attr $params "name" $FALSE;
|
||||||
If ($name -eq $FALSE) {
|
If ($name -eq $FALSE) {
|
||||||
Fail-Json (New-Object psobject) "missing required argument: name";
|
Fail-Json @{} "missing required argument: name";
|
||||||
}
|
}
|
||||||
|
|
||||||
# State parameter
|
# State parameter
|
||||||
$state = Get-Attr $params "state" $FALSE;
|
$state = Get-Attr $params "state" $FALSE;
|
||||||
$state.ToString().ToLower();
|
$state.ToString().ToLower();
|
||||||
If (($state -ne $FALSE) -and ($state -ne 'started') -and ($state -ne 'stopped') -and ($state -ne 'restarted') -and ($state -ne 'absent')) {
|
If (($state -ne $FALSE) -and ($state -ne 'started') -and ($state -ne 'stopped') -and ($state -ne 'restarted') -and ($state -ne 'absent')) {
|
||||||
Fail-Json (New-Object psobject) "state is '$state'; must be 'started', 'restarted', 'stopped' or 'absent'"
|
Fail-Json @{} "state is '$state'; must be 'started', 'restarted', 'stopped' or 'absent'"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Path parameter
|
# Path parameter
|
||||||
|
@ -65,8 +65,8 @@ if ((Get-Module "WebAdministration" -ErrorAction SilentlyContinue) -eq $null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Result
|
# Result
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
site = New-Object psobject
|
site = @{}
|
||||||
changed = $false
|
changed = $false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,13 +77,13 @@ Try {
|
||||||
# Add site
|
# Add site
|
||||||
If(($state -ne 'absent') -and (-not $site)) {
|
If(($state -ne 'absent') -and (-not $site)) {
|
||||||
If ($physical_path -eq $FALSE) {
|
If ($physical_path -eq $FALSE) {
|
||||||
Fail-Json (New-Object psobject) "missing required arguments: physical_path"
|
Fail-Json @{} "missing required arguments: physical_path"
|
||||||
}
|
}
|
||||||
ElseIf (-not (Test-Path $physical_path)) {
|
ElseIf (-not (Test-Path $physical_path)) {
|
||||||
Fail-Json (New-Object psobject) "specified folder must already exist: physical_path"
|
Fail-Json @{} "specified folder must already exist: physical_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_parameters = New-Object psobject @{
|
$site_parameters = @{
|
||||||
Name = $name
|
Name = $name
|
||||||
PhysicalPath = $physical_path
|
PhysicalPath = $physical_path
|
||||||
};
|
};
|
||||||
|
@ -129,7 +129,7 @@ Try {
|
||||||
# Change Physical Path if needed
|
# Change Physical Path if needed
|
||||||
if($physical_path) {
|
if($physical_path) {
|
||||||
If (-not (Test-Path $physical_path)) {
|
If (-not (Test-Path $physical_path)) {
|
||||||
Fail-Json (New-Object psobject) "specified folder must already exist: physical_path"
|
Fail-Json @{} "specified folder must already exist: physical_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
$folder = Get-Item $physical_path
|
$folder = Get-Item $physical_path
|
||||||
|
@ -173,7 +173,7 @@ Try {
|
||||||
}
|
}
|
||||||
Catch
|
Catch
|
||||||
{
|
{
|
||||||
Fail-Json (New-Object psobject) $_.Exception.Message
|
Fail-Json @{} $_.Exception.Message
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($state -ne 'absent')
|
if ($state -ne 'absent')
|
||||||
|
@ -183,7 +183,7 @@ if ($state -ne 'absent')
|
||||||
|
|
||||||
if ($site)
|
if ($site)
|
||||||
{
|
{
|
||||||
$result.site = New-Object psobject @{
|
$result.site = @{
|
||||||
Name = $site.Name
|
Name = $site.Name
|
||||||
ID = $site.ID
|
ID = $site.ID
|
||||||
State = $site.State
|
State = $site.State
|
||||||
|
|
|
@ -69,7 +69,7 @@ Function Get-PropertyObject($hive, $net_hive, $path, $property) {
|
||||||
$raw_value = $value
|
$raw_value = $value
|
||||||
}
|
}
|
||||||
|
|
||||||
$object = New-Object PSObject @{
|
$object = @{
|
||||||
raw_value = $raw_value
|
raw_value = $raw_value
|
||||||
value = $value
|
value = $value
|
||||||
type = $type
|
type = $type
|
||||||
|
|
|
@ -102,7 +102,7 @@ Function Set-CultureLegacy($culture) {
|
||||||
|
|
||||||
$lookup = New-Object Ansible.LocaleHelper($culture)
|
$lookup = New-Object Ansible.LocaleHelper($culture)
|
||||||
# hex values are from http://www.pinvoke.net/default.aspx/kernel32/GetLocaleInfoEx.html
|
# hex values are from http://www.pinvoke.net/default.aspx/kernel32/GetLocaleInfoEx.html
|
||||||
$wanted_values = New-Object PSObject @{
|
$wanted_values = @{
|
||||||
Locale = '{0:x8}' -f ([System.Globalization.CultureInfo]$culture).LCID
|
Locale = '{0:x8}' -f ([System.Globalization.CultureInfo]$culture).LCID
|
||||||
LocaleName = $culture
|
LocaleName = $culture
|
||||||
s1159 = $lookup.GetValueFromType(0x00000028)
|
s1159 = $lookup.GetValueFromType(0x00000028)
|
||||||
|
|
|
@ -20,7 +20,7 @@ $params = Parse-Args $args $true;
|
||||||
|
|
||||||
$data = Get-Attr $params "data" "pong";
|
$data = Get-Attr $params "data" "pong";
|
||||||
|
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
changed = $false
|
changed = $false
|
||||||
ping = "pong"
|
ping = "pong"
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ $x = $params.thisPropertyDoesNotExist
|
||||||
|
|
||||||
$data = Get-Attr $params "data" "pong";
|
$data = Get-Attr $params "data" "pong";
|
||||||
|
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
changed = $false
|
changed = $false
|
||||||
ping = $data
|
ping = $data
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ $params = Parse-Args $args $true;
|
||||||
|
|
||||||
$data = Get-Attr $params "data" "pong";
|
$data = Get-Attr $params "data" "pong";
|
||||||
|
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
changed = $false
|
changed = $false
|
||||||
ping = $data
|
ping = $data
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ $params = Parse-Args $args $true;
|
||||||
|
|
||||||
$data = Get-Attr $params "data" "pong";
|
$data = Get-Attr $params "data" "pong";
|
||||||
|
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
changed = $false
|
changed = $false
|
||||||
ping = $data
|
ping = $data
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@ $params = Parse-Args $args $true;
|
||||||
|
|
||||||
$data = Get-Attr $params "data" "pong";
|
$data = Get-Attr $params "data" "pong";
|
||||||
|
|
||||||
$result = New-Object psobject @{
|
$result = @{
|
||||||
changed = $false
|
changed = $false
|
||||||
ping = $data
|
ping = $data
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue