mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
#21440. Module Win_Regedit, pipe all calls to New-ItemProperty and Get-ItemProperty (when not stored as variable) to Out-Null (#21771)
This commit is contained in:
parent
7b30203016
commit
9d2d364a38
1 changed files with 5 additions and 5 deletions
|
@ -58,7 +58,7 @@ Function Test-ValueData {
|
|||
)
|
||||
|
||||
try {
|
||||
Get-ItemProperty -Path $Path -Name $Name
|
||||
Get-ItemProperty -Path $Path -Name $Name | Out-Null
|
||||
return $true
|
||||
} catch {
|
||||
return $false
|
||||
|
@ -188,7 +188,7 @@ if ($state -eq "present") {
|
|||
$null = $(Get-Item -Path $path -ErrorAction 'Stop').OpenSubKey('','ReadWriteSubTree').SetValue($null,$data)
|
||||
} else {
|
||||
Remove-ItemProperty -Path $path -Name $name
|
||||
New-ItemProperty -Path $path -Name $name -Value $data -PropertyType $type -Force
|
||||
New-ItemProperty -Path $path -Name $name -Value $data -PropertyType $type -Force | Out-Null
|
||||
}
|
||||
} catch {
|
||||
Fail-Json $result $_.Exception.Message
|
||||
|
@ -209,7 +209,7 @@ if ($state -eq "present") {
|
|||
try {
|
||||
if ($type -eq "none") {
|
||||
Remove-ItemProperty -Path $path -Name $name
|
||||
New-ItemProperty -Path $path -Name $name -Value $data -PropertyType $type -Force
|
||||
New-ItemProperty -Path $path -Name $name -Value $data -PropertyType $type -Force | Out-Null
|
||||
} else {
|
||||
Set-ItemProperty -Path $path -Name $name -Value $data
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ if ($state -eq "present") {
|
|||
# Add missing entry
|
||||
if (-not $check_mode) {
|
||||
try {
|
||||
New-ItemProperty -Path $path -Name $name -Value $data -PropertyType $type
|
||||
New-ItemProperty -Path $path -Name $name -Value $data -PropertyType $type | Out-Null
|
||||
} Catch {
|
||||
Fail-Json $result $_.Exception.Message
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ if ($state -eq "present") {
|
|||
try {
|
||||
$new_path = New-Item $path -Type directory -Force
|
||||
if ($name -ne $null) {
|
||||
$new_path | New-ItemProperty -Name $name -Value $data -PropertyType $type -Force
|
||||
$new_path | New-ItemProperty -Name $name -Value $data -PropertyType $type -Force | Out-Null
|
||||
}
|
||||
} catch {
|
||||
Fail-Json $result $_.Exception.Message
|
||||
|
|
Loading…
Reference in a new issue