From f7d000fe74feb0f8cb19a0984670cdb5f115823c Mon Sep 17 00:00:00 2001 From: Angus Williams Date: Fri, 6 Jan 2017 01:09:04 +0000 Subject: [PATCH] Stops New-PSDrive commandlet producing output which was causing warnings (#19873) --- lib/ansible/modules/windows/win_regedit.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/windows/win_regedit.ps1 b/lib/ansible/modules/windows/win_regedit.ps1 index 723a6c7b239..78497891b9f 100644 --- a/lib/ansible/modules/windows/win_regedit.ps1 +++ b/lib/ansible/modules/windows/win_regedit.ps1 @@ -21,9 +21,9 @@ $ErrorActionPreference = "Stop" # WANT_JSON # POWERSHELL_COMMON -New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR -ErrorAction SilentlyContinue -New-PSDrive -PSProvider registry -Root HKEY_USERS -Name HKU -ErrorAction SilentlyContinue -New-PSDrive -PSProvider registry -Root HKEY_CURRENT_CONFIG -Name HCCC -ErrorAction SilentlyContinue +New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR -ErrorAction SilentlyContinue | Out-Null +New-PSDrive -PSProvider registry -Root HKEY_USERS -Name HKU -ErrorAction SilentlyContinue | Out-Null +New-PSDrive -PSProvider registry -Root HKEY_CURRENT_CONFIG -Name HCCC -ErrorAction SilentlyContinue | Out-Null $params = Parse-Args $args; $result = New-Object PSObject; @@ -134,7 +134,7 @@ if($state -eq "present") { if (Test-RegistryValueData -Path $registryKey -Value $registryValue) { # handle binary data - $currentRegistryData =(Get-ItemProperty -Path $registryKey | Select-Object -ExpandProperty $registryValue) + $currentRegistryData =(Get-ItemProperty -Path $registryKey | Select-Object -ExpandProperty $registryValue) if ($registryValue.ToLower() -eq "(default)") { # Special case handling for the key's default property. Because .GetValueKind() doesn't work for the (default) key property