From 998e10035eb1c86939e0e98cca987e2f240aad7f Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Tue, 31 Jan 2017 13:59:46 +0100 Subject: [PATCH 01/14] Changed $ca parameter Changed $ca parameter from $ca = "'$CAServerFQDN\$CARootName' " to $ca = "$CAServerFQDN\$CARootName". Old parameter gave errors since '$CAServerFQDN (example: 'CA01.domain.com) could not be found when running the script. --- DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 index 88d848c5..bff0a082 100644 --- a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 +++ b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 @@ -128,7 +128,7 @@ function Get-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "'$CAServerFQDN\$CARootName'" + $ca = "$CAServerFQDN\$CARootName" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -278,7 +278,7 @@ function Set-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "'$CAServerFQDN\$CARootName'" + $ca = "$CAServerFQDN\$CARootName" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -589,7 +589,7 @@ function Test-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "'$CAServerFQDN\$CARootName'" + $ca = "$CAServerFQDN\$CARootName" # If the Subject does not contain a full X500 path, construct just the CN if (($Subject.split('=').count) -eq 1) From a3dddd3bf431d457cc99a7e84652f18d461589bc Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Thu, 9 Feb 2017 14:41:45 +0100 Subject: [PATCH 02/14] Revert "Changed $ca parameter" This reverts commit 998e10035eb1c86939e0e98cca987e2f240aad7f. --- DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 index bff0a082..88d848c5 100644 --- a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 +++ b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 @@ -128,7 +128,7 @@ function Get-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "$CAServerFQDN\$CARootName" + $ca = "'$CAServerFQDN\$CARootName'" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -278,7 +278,7 @@ function Set-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "$CAServerFQDN\$CARootName" + $ca = "'$CAServerFQDN\$CARootName'" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -589,7 +589,7 @@ function Test-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "$CAServerFQDN\$CARootName" + $ca = "'$CAServerFQDN\$CARootName'" # If the Subject does not contain a full X500 path, construct just the CN if (($Subject.split('=').count) -eq 1) From 92f61178e7ccbe5a2adf99460d6538ec3b75bbb4 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Thu, 9 Feb 2017 17:24:54 +0100 Subject: [PATCH 03/14] Revert "Revert "Changed $ca parameter"" This reverts commit a3dddd3bf431d457cc99a7e84652f18d461589bc. --- DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 index 88d848c5..bff0a082 100644 --- a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 +++ b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 @@ -128,7 +128,7 @@ function Get-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "'$CAServerFQDN\$CARootName'" + $ca = "$CAServerFQDN\$CARootName" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -278,7 +278,7 @@ function Set-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "'$CAServerFQDN\$CARootName'" + $ca = "$CAServerFQDN\$CARootName" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -589,7 +589,7 @@ function Test-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "'$CAServerFQDN\$CARootName'" + $ca = "$CAServerFQDN\$CARootName" # If the Subject does not contain a full X500 path, construct just the CN if (($Subject.split('=').count) -eq 1) From 230fce461add5bd9be7ff89fe4ccef130266cfa2 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Wed, 15 Feb 2017 15:03:06 +0100 Subject: [PATCH 04/14] Changed all lines as discussed under PR 43 and issue 42 Changed all lines as discussed under PR 43 and issue 42 --- DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 | 6 +++--- ReadMe.md | 7 +++++++ Tests/Integration/MSFT_xCertReq.config.ps1 | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 index bff0a082..58bd6962 100644 --- a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 +++ b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 @@ -405,8 +405,8 @@ RenewalCert = $Thumbprint $certReqOutPath = [System.IO.Path]::ChangeExtension($workingPath,'.out') $command = "$PSHOME\PowerShell.exe" $arguments = "-Command ""& $ENV:SystemRoot\system32\certreq.exe" + ` - " @('-submit','-q','-config',$ca,'$reqPath','$cerPath')" + ` - " | Set-Content -Path '$certReqOutPath'""" + " @('-submit','-q','-config','$ca','$reqPath','$cerPath')" + ` + " | Set-Content -Path '$certReqOutPath'""" # This may output a win32-process object, but it often does not because of # a timing issue in PDT (the process has often completed before the @@ -421,7 +421,7 @@ RenewalCert = $Thumbprint $($LocalizedData.SubmittingRequestProcessCertificateMessage) ) -join '' ) - $null = Wait-Win32ProcessEnd ` + $null = Wait-Win32ProcessStop ` -Path $command ` -Arguments $arguments ` -Credential $Credential diff --git a/ReadMe.md b/ReadMe.md index 50c31fe9..7acc9611 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -56,6 +56,13 @@ Please check out common DSC Resources [contributing guidelines](https://github.c ### Unreleased +- xCertReq: + - Fixing issue #42 (Error when requesting cerificate using $credential and error regarding single quotes around the $ca variable value): + - Removed single quotes in three lines (131, 281 and 592) around the $ca variable value. + - Added single quotes around the $ca variable in line 408 when requesting the certificate. + - Changed function WaitProcessEnd to function WaitProcessStop (line 424). + - Changed line 22 of the integration test (`Exportable = $($Exportable.ToString().ToUpper())` to `Exportable = $Exportable`), so the manual integration tests work. + ### 2.3.0.0 - xCertReq: diff --git a/Tests/Integration/MSFT_xCertReq.config.ps1 b/Tests/Integration/MSFT_xCertReq.config.ps1 index e140c8fe..97e48aa6 100644 --- a/Tests/Integration/MSFT_xCertReq.config.ps1 +++ b/Tests/Integration/MSFT_xCertReq.config.ps1 @@ -19,7 +19,7 @@ $TestCertReq = [PSObject]@{ CARootName = $CARootName Credential = $Credential KeyLength = $KeyLength - Exportable = $($Exportable.ToString().ToUpper()) + Exportable = $Exportable ProviderName = $ProviderName OID = $OID KeyUsage = $KeyUsage From 3494dfac8cdc3657622b534be88640f2dc8be400 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Wed, 15 Feb 2017 15:15:56 +0100 Subject: [PATCH 05/14] Chnaged unit test --- Tests/Unit/MSFT_xCertReq.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xCertReq.tests.ps1 b/Tests/Unit/MSFT_xCertReq.tests.ps1 index d41aa654..fa513560 100644 --- a/Tests/Unit/MSFT_xCertReq.tests.ps1 +++ b/Tests/Unit/MSFT_xCertReq.tests.ps1 @@ -538,7 +538,7 @@ RenewalCert = $validThumbprint function Wait-Win32ProcessEnd { param ( $Path,$Arguments,$Credential ) } Mock -CommandName Start-Win32Process -ModuleName MSFT_xCertReq - Mock -CommandName Wait-Win32ProcessEnd -ModuleName MSFT_xCertReq + Mock -CommandName Wait-Win32ProcessStop -ModuleName MSFT_xCertReq It 'should not throw' { { Set-TargetResource @Params } | Should Not Throw From 731872f2d714d0283a6aef791e21ea6777054405 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Thu, 2 Mar 2017 08:26:46 +0100 Subject: [PATCH 06/14] Revert "Chnaged unit test" This reverts commit 3494dfac8cdc3657622b534be88640f2dc8be400. --- Tests/Unit/MSFT_xCertReq.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xCertReq.tests.ps1 b/Tests/Unit/MSFT_xCertReq.tests.ps1 index fa513560..d41aa654 100644 --- a/Tests/Unit/MSFT_xCertReq.tests.ps1 +++ b/Tests/Unit/MSFT_xCertReq.tests.ps1 @@ -538,7 +538,7 @@ RenewalCert = $validThumbprint function Wait-Win32ProcessEnd { param ( $Path,$Arguments,$Credential ) } Mock -CommandName Start-Win32Process -ModuleName MSFT_xCertReq - Mock -CommandName Wait-Win32ProcessStop -ModuleName MSFT_xCertReq + Mock -CommandName Wait-Win32ProcessEnd -ModuleName MSFT_xCertReq It 'should not throw' { { Set-TargetResource @Params } | Should Not Throw From cbd895acfd8a84d091d8ebd087ae1802953b01b5 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Thu, 2 Mar 2017 08:48:24 +0100 Subject: [PATCH 07/14] commit tests --- Tests/Unit/MSFT_xCertReq.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xCertReq.tests.ps1 b/Tests/Unit/MSFT_xCertReq.tests.ps1 index d41aa654..6b367e4b 100644 --- a/Tests/Unit/MSFT_xCertReq.tests.ps1 +++ b/Tests/Unit/MSFT_xCertReq.tests.ps1 @@ -282,7 +282,7 @@ RenewalCert = $validThumbprint #region Set-TargetResource Describe "$DSCResourceName\Set-TargetResource" { Mock -CommandName Join-Path -MockWith { 'xCertReq-Test' } ` - -ParameterFilter { $Path -eq $ENV:Temp } + -ParameterFilter { $Path -eq $env:Temp } Mock -CommandName Test-Path -MockWith { $true } ` -ParameterFilter { $Path -eq 'xCertReq-Test.req' } Mock -CommandName Test-Path -MockWith { $true } ` From 8f402ac120caea549521a3878b9bda8038596abb Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Thu, 2 Mar 2017 09:12:34 +0100 Subject: [PATCH 08/14] Revert "commit tests" This reverts commit cbd895acfd8a84d091d8ebd087ae1802953b01b5. --- Tests/Unit/MSFT_xCertReq.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xCertReq.tests.ps1 b/Tests/Unit/MSFT_xCertReq.tests.ps1 index 6b367e4b..d41aa654 100644 --- a/Tests/Unit/MSFT_xCertReq.tests.ps1 +++ b/Tests/Unit/MSFT_xCertReq.tests.ps1 @@ -282,7 +282,7 @@ RenewalCert = $validThumbprint #region Set-TargetResource Describe "$DSCResourceName\Set-TargetResource" { Mock -CommandName Join-Path -MockWith { 'xCertReq-Test' } ` - -ParameterFilter { $Path -eq $env:Temp } + -ParameterFilter { $Path -eq $ENV:Temp } Mock -CommandName Test-Path -MockWith { $true } ` -ParameterFilter { $Path -eq 'xCertReq-Test.req' } Mock -CommandName Test-Path -MockWith { $true } ` From 97ca5c670399f40f2df1db85dcd479e63ebfbd41 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Thu, 2 Mar 2017 09:36:06 +0100 Subject: [PATCH 09/14] Revert "Changed all lines as discussed under PR 43 and issue 42" This reverts commit 230fce461add5bd9be7ff89fe4ccef130266cfa2. --- DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 | 6 +++--- ReadMe.md | 7 ------- Tests/Integration/MSFT_xCertReq.config.ps1 | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 index 58bd6962..bff0a082 100644 --- a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 +++ b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 @@ -405,8 +405,8 @@ RenewalCert = $Thumbprint $certReqOutPath = [System.IO.Path]::ChangeExtension($workingPath,'.out') $command = "$PSHOME\PowerShell.exe" $arguments = "-Command ""& $ENV:SystemRoot\system32\certreq.exe" + ` - " @('-submit','-q','-config','$ca','$reqPath','$cerPath')" + ` - " | Set-Content -Path '$certReqOutPath'""" + " @('-submit','-q','-config',$ca,'$reqPath','$cerPath')" + ` + " | Set-Content -Path '$certReqOutPath'""" # This may output a win32-process object, but it often does not because of # a timing issue in PDT (the process has often completed before the @@ -421,7 +421,7 @@ RenewalCert = $Thumbprint $($LocalizedData.SubmittingRequestProcessCertificateMessage) ) -join '' ) - $null = Wait-Win32ProcessStop ` + $null = Wait-Win32ProcessEnd ` -Path $command ` -Arguments $arguments ` -Credential $Credential diff --git a/ReadMe.md b/ReadMe.md index 7acc9611..50c31fe9 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -56,13 +56,6 @@ Please check out common DSC Resources [contributing guidelines](https://github.c ### Unreleased -- xCertReq: - - Fixing issue #42 (Error when requesting cerificate using $credential and error regarding single quotes around the $ca variable value): - - Removed single quotes in three lines (131, 281 and 592) around the $ca variable value. - - Added single quotes around the $ca variable in line 408 when requesting the certificate. - - Changed function WaitProcessEnd to function WaitProcessStop (line 424). - - Changed line 22 of the integration test (`Exportable = $($Exportable.ToString().ToUpper())` to `Exportable = $Exportable`), so the manual integration tests work. - ### 2.3.0.0 - xCertReq: diff --git a/Tests/Integration/MSFT_xCertReq.config.ps1 b/Tests/Integration/MSFT_xCertReq.config.ps1 index 3011b392..f1304a7d 100644 --- a/Tests/Integration/MSFT_xCertReq.config.ps1 +++ b/Tests/Integration/MSFT_xCertReq.config.ps1 @@ -19,7 +19,7 @@ $TestCertReq = [PSObject]@{ CARootName = $CARootName Credential = $Credential KeyLength = $KeyLength - Exportable = $Exportable + Exportable = $($Exportable.ToString().ToUpper()) ProviderName = $ProviderName OID = $OID KeyUsage = $KeyUsage From 79ed95fc11d8a9e0e67d0eaf70e03bee452c8559 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Thu, 2 Mar 2017 09:41:59 +0100 Subject: [PATCH 10/14] Revert "Revert "Changed all lines as discussed under PR 43 and issue 42"" This reverts commit 97ca5c670399f40f2df1db85dcd479e63ebfbd41. --- DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 | 6 +++--- ReadMe.md | 7 +++++++ Tests/Integration/MSFT_xCertReq.config.ps1 | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 index bff0a082..58bd6962 100644 --- a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 +++ b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 @@ -405,8 +405,8 @@ RenewalCert = $Thumbprint $certReqOutPath = [System.IO.Path]::ChangeExtension($workingPath,'.out') $command = "$PSHOME\PowerShell.exe" $arguments = "-Command ""& $ENV:SystemRoot\system32\certreq.exe" + ` - " @('-submit','-q','-config',$ca,'$reqPath','$cerPath')" + ` - " | Set-Content -Path '$certReqOutPath'""" + " @('-submit','-q','-config','$ca','$reqPath','$cerPath')" + ` + " | Set-Content -Path '$certReqOutPath'""" # This may output a win32-process object, but it often does not because of # a timing issue in PDT (the process has often completed before the @@ -421,7 +421,7 @@ RenewalCert = $Thumbprint $($LocalizedData.SubmittingRequestProcessCertificateMessage) ) -join '' ) - $null = Wait-Win32ProcessEnd ` + $null = Wait-Win32ProcessStop ` -Path $command ` -Arguments $arguments ` -Credential $Credential diff --git a/ReadMe.md b/ReadMe.md index 50c31fe9..7acc9611 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -56,6 +56,13 @@ Please check out common DSC Resources [contributing guidelines](https://github.c ### Unreleased +- xCertReq: + - Fixing issue #42 (Error when requesting cerificate using $credential and error regarding single quotes around the $ca variable value): + - Removed single quotes in three lines (131, 281 and 592) around the $ca variable value. + - Added single quotes around the $ca variable in line 408 when requesting the certificate. + - Changed function WaitProcessEnd to function WaitProcessStop (line 424). + - Changed line 22 of the integration test (`Exportable = $($Exportable.ToString().ToUpper())` to `Exportable = $Exportable`), so the manual integration tests work. + ### 2.3.0.0 - xCertReq: diff --git a/Tests/Integration/MSFT_xCertReq.config.ps1 b/Tests/Integration/MSFT_xCertReq.config.ps1 index f1304a7d..3011b392 100644 --- a/Tests/Integration/MSFT_xCertReq.config.ps1 +++ b/Tests/Integration/MSFT_xCertReq.config.ps1 @@ -19,7 +19,7 @@ $TestCertReq = [PSObject]@{ CARootName = $CARootName Credential = $Credential KeyLength = $KeyLength - Exportable = $($Exportable.ToString().ToUpper()) + Exportable = $Exportable ProviderName = $ProviderName OID = $OID KeyUsage = $KeyUsage From 5867cdeb62f491cebf505c1978506db9a784d22d Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Mon, 6 Mar 2017 13:04:09 +0100 Subject: [PATCH 11/14] Merge tests --- Tests/Integration/MSFT_xCertReq.config.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/MSFT_xCertReq.config.ps1 b/Tests/Integration/MSFT_xCertReq.config.ps1 index 3011b392..97e48aa6 100644 --- a/Tests/Integration/MSFT_xCertReq.config.ps1 +++ b/Tests/Integration/MSFT_xCertReq.config.ps1 @@ -1,5 +1,5 @@ # This will fail if the machine does not have a CA Configured. -$CertUtilResult = & "$env:SystemRoot\system32\certutil.exe" @('-dump') +$CertUtilResult = & "$ENV:SystemRoot\system32\certutil.exe" @('-dump') $CAServerFQDN = ([regex]::matches($CertUtilResult,'Server:[ \t]+`([A-Za-z0-9._-]+)''','IgnoreCase')).Groups[1].Value $CARootName = ([regex]::matches($CertUtilResult,'Name:[ \t]+`([\sA-Za-z0-9._-]+)''','IgnoreCase')).Groups[1].Value $KeyLength = '1024' From 80e8447bf5c6e9b5ea72b4a6bfdb18937af7743f Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Mon, 6 Mar 2017 13:12:15 +0100 Subject: [PATCH 12/14] changed unit test to match actual script ProcessStop instead of ProcessEnd line 560 --- Tests/Unit/MSFT_xCertReq.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xCertReq.tests.ps1 b/Tests/Unit/MSFT_xCertReq.tests.ps1 index d41aa654..a180d1bc 100644 --- a/Tests/Unit/MSFT_xCertReq.tests.ps1 +++ b/Tests/Unit/MSFT_xCertReq.tests.ps1 @@ -557,7 +557,7 @@ RenewalCert = $validThumbprint } Assert-MockCalled -CommandName CertReq.exe -Exactly 2 Assert-MockCalled -CommandName Start-Win32Process -ModuleName MSFT_xCertReq -Exactly 1 - Assert-MockCalled -CommandName Wait-Win32ProcessEnd -ModuleName MSFT_xCertReq -Exactly 1 + Assert-MockCalled -CommandName Wait-Win32ProcessStop -ModuleName MSFT_xCertReq -Exactly 1 Assert-MockCalled -CommandName Test-Path -Exactly 1 ` -ParameterFilter { $Path -eq 'xCertReq-Test.out' } Assert-MockCalled -CommandName Get-Content -Exactly 1 ` From 91e8ad6d0d6e828a7cc2bec6c88803227b7f279b Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Mon, 6 Mar 2017 13:42:21 +0100 Subject: [PATCH 13/14] changed test again --- Tests/Unit/MSFT_xCertReq.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/MSFT_xCertReq.tests.ps1 b/Tests/Unit/MSFT_xCertReq.tests.ps1 index a180d1bc..d41aa654 100644 --- a/Tests/Unit/MSFT_xCertReq.tests.ps1 +++ b/Tests/Unit/MSFT_xCertReq.tests.ps1 @@ -557,7 +557,7 @@ RenewalCert = $validThumbprint } Assert-MockCalled -CommandName CertReq.exe -Exactly 2 Assert-MockCalled -CommandName Start-Win32Process -ModuleName MSFT_xCertReq -Exactly 1 - Assert-MockCalled -CommandName Wait-Win32ProcessStop -ModuleName MSFT_xCertReq -Exactly 1 + Assert-MockCalled -CommandName Wait-Win32ProcessEnd -ModuleName MSFT_xCertReq -Exactly 1 Assert-MockCalled -CommandName Test-Path -Exactly 1 ` -ParameterFilter { $Path -eq 'xCertReq-Test.out' } Assert-MockCalled -CommandName Get-Content -Exactly 1 ` From 086f6f3d93a128bc860f6df72ca26527a7968e79 Mon Sep 17 00:00:00 2001 From: Sven van Rijen Date: Sun, 12 Mar 2017 21:48:07 +0100 Subject: [PATCH 14/14] Revert "Changed $ca parameter" This reverts commit 998e10035eb1c86939e0e98cca987e2f240aad7f. --- DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 index 58bd6962..251b72f5 100644 --- a/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 +++ b/DSCResources/MSFT_xCertReq/MSFT_xCertReq.psm1 @@ -128,7 +128,7 @@ function Get-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "$CAServerFQDN\$CARootName" + $ca = "'$CAServerFQDN\$CARootName'" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -278,7 +278,7 @@ function Set-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "$CAServerFQDN\$CARootName" + $ca = "'$CAServerFQDN\$CARootName'" Write-Verbose -Message ( @( "$($MyInvocation.MyCommand): " @@ -589,7 +589,7 @@ function Test-TargetResource ) # The certificate authority, accessible on the local area network - $ca = "$CAServerFQDN\$CARootName" + $ca = "'$CAServerFQDN\$CARootName'" # If the Subject does not contain a full X500 path, construct just the CN if (($Subject.split('=').count) -eq 1)