From 66ddd983d5ca0d1dc106b9e8d5af7521dc212c50 Mon Sep 17 00:00:00 2001 From: Svilen Sultanov Date: Mon, 19 Aug 2019 21:51:49 +0200 Subject: [PATCH] PR Comments fixed --- DSCResources/MSFT_ADUser/MSFT_ADUser.psm1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DSCResources/MSFT_ADUser/MSFT_ADUser.psm1 b/DSCResources/MSFT_ADUser/MSFT_ADUser.psm1 index 1621abc76..802ef5a0b 100644 --- a/DSCResources/MSFT_ADUser/MSFT_ADUser.psm1 +++ b/DSCResources/MSFT_ADUser/MSFT_ADUser.psm1 @@ -928,10 +928,12 @@ function Test-TargetResource { $getParameters['DomainController'] = $PSBoundParameters['DomainController'] } + if ($PSBoundParameters.ContainsKey('Credential')) { $getParameters['Credential'] = $PSBoundParameters['Credential'] } + $targetResource = Get-TargetResource @getParameters $isCompliant = $true @@ -1594,10 +1596,12 @@ function Set-TargetResource { $getParameters['DomainController'] = $PSBoundParameters['DomainController'] } + if ($PSBoundParameters.ContainsKey('Credential')) { $getParameters['Credential'] = $PSBoundParameters['Credential'] } + $targetResource = Get-TargetResource @getParameters # Add common name, ensure and enabled as they may not be explicitly passed @@ -2070,7 +2074,7 @@ function Get-MD5HashString $md5 = [System.Security.Cryptography.MD5]::Create() $hashBytes = $md5.ComputeHash($Bytes) - $md5ReturnValue = [System.BitConverter]::ToString($hashBytes).Replace('-','') + $md5ReturnValue = [System.BitConverter]::ToString($hashBytes).Replace('-', '') } return $md5ReturnValue