From 81a84074abfbfbd3e9aca072d8d4b626d2e95512 Mon Sep 17 00:00:00 2001 From: Daniel Hughes Date: Tue, 2 Apr 2024 14:24:13 +0100 Subject: [PATCH 1/6] Fix AdcsAuthorityInformationAccess: always makes a change #138 --- CHANGELOG.md | 7 +++++++ .../DSC_AdcsAuthorityInformationAccess.psm1 | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c367696..6305886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- AdcsAuthorityInformationAccess + - Removed `AllowRestartService` parameter from compared settings, force `Get-CaAiaUriList` + to return unmangled `System.String[]` with single values. + Fixes [Issue #138](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/138). + ### Changed - ActiveDirectoryCSDsc diff --git a/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 b/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 index 5321e97..5141116 100644 --- a/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 +++ b/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 @@ -205,6 +205,7 @@ function Test-TargetResource -Verbose:$VerbosePreference $null = $PSBoundParameters.Remove('IsSingleInstance') + $null = $PSBoundParameters.Remove('AllowRestartService') return Test-DscParameterState ` -CurrentValues $currentSettings ` @@ -234,7 +235,8 @@ function Get-CaAiaUriList Write-Verbose -Message ($script:localizedData.GettingAiaUrisMessage -f $ExtensionType) - return [System.String[]] (Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri + $UriList = [System.String[]](Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri + return ,$UriList } Export-ModuleMember -Function *-TargetResource From 7b0cc99e89163f9ad9c735c05b8596b00039eace Mon Sep 17 00:00:00 2001 From: Daniel Hughes Date: Tue, 2 Apr 2024 15:57:46 +0100 Subject: [PATCH 2/6] Fix build and update changelog --- CHANGELOG.md | 3 +- azure-pipelines.yml | 150 ++++++++++++-------------------------------- 2 files changed, 42 insertions(+), 111 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c367696..676eff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated `GitVersion.yml` to latest pattern - Fixes [Issue #126](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/126). - Updated build to use `Sampler.GitHubTasks` - Fixes [Issue #129](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/129). - Added support for publishing code coverage to `CodeCov.io` and - Azure Pipelines - Fixes [Issue #130](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/130). +- Azure Pipelines - Fixes [Issue #130](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/130). +- Azure pipelines - Remove deprecated images, make the build work ## [5.0.0] - 2020-06-20 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a712bcc..16b457b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,14 +24,17 @@ stages: - job: Package_Module displayName: 'Package Module' pool: - vmImage: 'ubuntu 16.04' + vmImage: 'windows-latest' steps: - - task: GitVersion@5 - name: gitversion - displayName: 'Evaluate Next Version' - inputs: - runtime: 'core' - configFilePath: 'GitVersion.yml' + - pwsh: | + dotnet tool install --global GitVersion.Tool + $gitVersionObject = dotnet-gitversion | ConvertFrom-Json + $gitVersionObject.PSObject.Properties.ForEach{ + Write-Host -Object "Setting Task Variable '$($_.Name)' with value '$($_.Value)'." + Write-Host -Object "##vso[task.setvariable variable=$($_.Name);]$($_.Value)" + } + Write-Host -Object "##vso[build.updatebuildnumber]$($gitVersionObject.FullSemVer)" + displayName: Calculate ModuleVersion (GitVersion) - task: PowerShell@2 name: package @@ -41,7 +44,7 @@ stages: arguments: '-Tasks pack -ResolveDependency' pwsh: true env: - ModuleVersion: $(gitVersion.Informationalversion) + ModuleVersion: $(NuGetVersionV2) - task: PublishPipelineArtifact@1 displayName: 'Publish Pipeline Artifact' @@ -57,11 +60,11 @@ stages: - job: Test_HQRM displayName: 'HQRM' pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Build Artifact' inputs: buildType: 'current' artifactName: $(buildArtifactName) @@ -83,14 +86,14 @@ stages: testRunTitle: 'HQRM' condition: succeededOrFailed() - - job: Test_Unit_2016 - displayName: 'Unit (Windows Server 2016)' + - job: Test_Unit + displayName: 'Unit' pool: - vmImage: 'vs2017-win2016' + vmImage: 'windows-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Build Artifact' inputs: buildType: 'current' artifactName: $(buildArtifactName) @@ -109,7 +112,7 @@ stages: inputs: testResultsFormat: 'NUnit' testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Unit (Windows Server 2016)' + testRunTitle: 'Unit' condition: succeededOrFailed() - task: PublishPipelineArtifact@1 @@ -117,44 +120,14 @@ stages: inputs: targetPath: '$(buildFolderName)/$(testResultFolderName)/' artifactName: $(testArtifactName) + # If several pipeline jobs are generating code coverage, replace above with this: + #artifactName: 'CodeCoverageWindows' # Can be any, in the pipeline, unique name parallel: true - - job: Code_Coverage - displayName: 'Publish Code Coverage' - dependsOn: Test_Unit_2016 - pool: - vmImage: 'ubuntu 16.04' - timeoutInMinutes: 0 - steps: - - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' - inputs: - buildType: 'current' - artifactName: $(buildArtifactName) - targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - - - task: DownloadPipelineArtifact@2 - displayName: 'Download Test Artifact' - inputs: - buildType: 'current' - artifactName: $(testArtifactName) - targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)' - - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage to Azure DevOps' - inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml' - pathToSources: '$(Build.SourcesDirectory)/$(sourceFolderName)/' - - - script: | - bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml" - displayName: 'Publish Code Coverage to Codecov.io' - - - job: Test_Integration_2016 - displayName: 'Integration (Windows Server 2016)' + - job: Test_Integration + displayName: 'Integration' pool: - vmImage: 'vs2017-win2016' + vmImage: 'windows-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 @@ -193,82 +166,39 @@ stages: inputs: testResultsFormat: 'NUnit' testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Integration (Windows Server 2016)' + testRunTitle: 'Integration' condition: succeededOrFailed() - - job: Test_Unit_2019 - displayName: 'Unit (Windows Server 2019)' + - job: Code_Coverage + displayName: 'Publish Code Coverage' + dependsOn: Test_Unit pool: - vmImage: 'windows-2019' + vmImage: 'ubuntu-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Build Artifact' inputs: buildType: 'current' artifactName: $(buildArtifactName) targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - - task: PowerShell@2 - name: test - displayName: 'Run Unit Test' - inputs: - filePath: './build.ps1' - arguments: "-Tasks test -PesterScript 'tests/Unit'" - pwsh: false - - - task: PublishTestResults@2 - displayName: 'Publish Test Results' - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Unit (Windows Server 2019)' - condition: succeededOrFailed() - - - job: Test_Integration_2019 - displayName: 'Integration (Windows Server 2019)' - pool: - vmImage: 'windows-2019' - timeoutInMinutes: 0 - steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Test Artifact' inputs: buildType: 'current' - artifactName: $(buildArtifactName) - targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - - - task: PowerShell@2 - name: configureWinRM - displayName: 'Configure WinRM' - inputs: - targetType: 'inline' - script: 'winrm quickconfig -quiet' - pwsh: false - - - task: PowerShell@2 - name: installADCSFeatures - displayName: 'Install ADCS Features' - inputs: - targetType: 'inline' - script: 'Install-WindowsFeature -Name ADCS-Cert-Authority, RSAT-ADCS' - pwsh: false + artifactName: $(testArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)' - - task: PowerShell@2 - name: test - displayName: 'Run Integration Test' + - task: PublishCodeCoverageResults@2 + displayName: 'Publish Code Coverage to Azure DevOps' inputs: - filePath: './build.ps1' - arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0" - pwsh: false + summaryFileLocation: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml' + pathToSources: '$(Build.SourcesDirectory)/$(sourceFolderName)/' - - task: PublishTestResults@2 - displayName: 'Publish Test Results' - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Integration (Windows Server 2019)' - condition: succeededOrFailed() + - script: | + bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml" + displayName: 'Publish Code Coverage to Codecov.io' - stage: Deploy dependsOn: Test @@ -285,7 +215,7 @@ stages: - job: Deploy_Module displayName: 'Deploy Module' pool: - vmImage: 'ubuntu 16.04' + vmImage: 'ubuntu-latest' steps: - task: DownloadPipelineArtifact@2 displayName: 'Download Pipeline Artifact' From 03d7c2e91b72b4e3c8a8120c9cd9a852464a0a6b Mon Sep 17 00:00:00 2001 From: Daniel Hughes Date: Tue, 2 Apr 2024 14:24:13 +0100 Subject: [PATCH 3/6] Fix AdcsAuthorityInformationAccess: always makes a change #138 --- CHANGELOG.md | 7 +++++++ .../DSC_AdcsAuthorityInformationAccess.psm1 | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 676eff3..b313239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- AdcsAuthorityInformationAccess + - Removed `AllowRestartService` parameter from compared settings, force `Get-CaAiaUriList` + to return unmangled `System.String[]` with single values. + Fixes [Issue #138](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/138). + ### Changed - ActiveDirectoryCSDsc diff --git a/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 b/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 index 5321e97..5141116 100644 --- a/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 +++ b/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 @@ -205,6 +205,7 @@ function Test-TargetResource -Verbose:$VerbosePreference $null = $PSBoundParameters.Remove('IsSingleInstance') + $null = $PSBoundParameters.Remove('AllowRestartService') return Test-DscParameterState ` -CurrentValues $currentSettings ` @@ -234,7 +235,8 @@ function Get-CaAiaUriList Write-Verbose -Message ($script:localizedData.GettingAiaUrisMessage -f $ExtensionType) - return [System.String[]] (Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri + $UriList = [System.String[]](Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri + return ,$UriList } Export-ModuleMember -Function *-TargetResource From 6a5cbf4c490989a787a31e796cf99f5ee3a5ba2d Mon Sep 17 00:00:00 2001 From: Daniel Hughes <2237515+dan-hughes@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:22:08 +0100 Subject: [PATCH 4/6] Fix build and update changelog (#140) --- CHANGELOG.md | 3 +- azure-pipelines.yml | 150 ++++++++++++-------------------------------- 2 files changed, 42 insertions(+), 111 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c367696..676eff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated `GitVersion.yml` to latest pattern - Fixes [Issue #126](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/126). - Updated build to use `Sampler.GitHubTasks` - Fixes [Issue #129](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/129). - Added support for publishing code coverage to `CodeCov.io` and - Azure Pipelines - Fixes [Issue #130](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/130). +- Azure Pipelines - Fixes [Issue #130](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/130). +- Azure pipelines - Remove deprecated images, make the build work ## [5.0.0] - 2020-06-20 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a712bcc..16b457b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,14 +24,17 @@ stages: - job: Package_Module displayName: 'Package Module' pool: - vmImage: 'ubuntu 16.04' + vmImage: 'windows-latest' steps: - - task: GitVersion@5 - name: gitversion - displayName: 'Evaluate Next Version' - inputs: - runtime: 'core' - configFilePath: 'GitVersion.yml' + - pwsh: | + dotnet tool install --global GitVersion.Tool + $gitVersionObject = dotnet-gitversion | ConvertFrom-Json + $gitVersionObject.PSObject.Properties.ForEach{ + Write-Host -Object "Setting Task Variable '$($_.Name)' with value '$($_.Value)'." + Write-Host -Object "##vso[task.setvariable variable=$($_.Name);]$($_.Value)" + } + Write-Host -Object "##vso[build.updatebuildnumber]$($gitVersionObject.FullSemVer)" + displayName: Calculate ModuleVersion (GitVersion) - task: PowerShell@2 name: package @@ -41,7 +44,7 @@ stages: arguments: '-Tasks pack -ResolveDependency' pwsh: true env: - ModuleVersion: $(gitVersion.Informationalversion) + ModuleVersion: $(NuGetVersionV2) - task: PublishPipelineArtifact@1 displayName: 'Publish Pipeline Artifact' @@ -57,11 +60,11 @@ stages: - job: Test_HQRM displayName: 'HQRM' pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Build Artifact' inputs: buildType: 'current' artifactName: $(buildArtifactName) @@ -83,14 +86,14 @@ stages: testRunTitle: 'HQRM' condition: succeededOrFailed() - - job: Test_Unit_2016 - displayName: 'Unit (Windows Server 2016)' + - job: Test_Unit + displayName: 'Unit' pool: - vmImage: 'vs2017-win2016' + vmImage: 'windows-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Build Artifact' inputs: buildType: 'current' artifactName: $(buildArtifactName) @@ -109,7 +112,7 @@ stages: inputs: testResultsFormat: 'NUnit' testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Unit (Windows Server 2016)' + testRunTitle: 'Unit' condition: succeededOrFailed() - task: PublishPipelineArtifact@1 @@ -117,44 +120,14 @@ stages: inputs: targetPath: '$(buildFolderName)/$(testResultFolderName)/' artifactName: $(testArtifactName) + # If several pipeline jobs are generating code coverage, replace above with this: + #artifactName: 'CodeCoverageWindows' # Can be any, in the pipeline, unique name parallel: true - - job: Code_Coverage - displayName: 'Publish Code Coverage' - dependsOn: Test_Unit_2016 - pool: - vmImage: 'ubuntu 16.04' - timeoutInMinutes: 0 - steps: - - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' - inputs: - buildType: 'current' - artifactName: $(buildArtifactName) - targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - - - task: DownloadPipelineArtifact@2 - displayName: 'Download Test Artifact' - inputs: - buildType: 'current' - artifactName: $(testArtifactName) - targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)' - - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage to Azure DevOps' - inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml' - pathToSources: '$(Build.SourcesDirectory)/$(sourceFolderName)/' - - - script: | - bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml" - displayName: 'Publish Code Coverage to Codecov.io' - - - job: Test_Integration_2016 - displayName: 'Integration (Windows Server 2016)' + - job: Test_Integration + displayName: 'Integration' pool: - vmImage: 'vs2017-win2016' + vmImage: 'windows-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 @@ -193,82 +166,39 @@ stages: inputs: testResultsFormat: 'NUnit' testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Integration (Windows Server 2016)' + testRunTitle: 'Integration' condition: succeededOrFailed() - - job: Test_Unit_2019 - displayName: 'Unit (Windows Server 2019)' + - job: Code_Coverage + displayName: 'Publish Code Coverage' + dependsOn: Test_Unit pool: - vmImage: 'windows-2019' + vmImage: 'ubuntu-latest' timeoutInMinutes: 0 steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Build Artifact' inputs: buildType: 'current' artifactName: $(buildArtifactName) targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - - task: PowerShell@2 - name: test - displayName: 'Run Unit Test' - inputs: - filePath: './build.ps1' - arguments: "-Tasks test -PesterScript 'tests/Unit'" - pwsh: false - - - task: PublishTestResults@2 - displayName: 'Publish Test Results' - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Unit (Windows Server 2019)' - condition: succeededOrFailed() - - - job: Test_Integration_2019 - displayName: 'Integration (Windows Server 2019)' - pool: - vmImage: 'windows-2019' - timeoutInMinutes: 0 - steps: - task: DownloadPipelineArtifact@2 - displayName: 'Download Pipeline Artifact' + displayName: 'Download Test Artifact' inputs: buildType: 'current' - artifactName: $(buildArtifactName) - targetPath: '$(Build.SourcesDirectory)/$(buildArtifactName)' - - - task: PowerShell@2 - name: configureWinRM - displayName: 'Configure WinRM' - inputs: - targetType: 'inline' - script: 'winrm quickconfig -quiet' - pwsh: false - - - task: PowerShell@2 - name: installADCSFeatures - displayName: 'Install ADCS Features' - inputs: - targetType: 'inline' - script: 'Install-WindowsFeature -Name ADCS-Cert-Authority, RSAT-ADCS' - pwsh: false + artifactName: $(testArtifactName) + targetPath: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)' - - task: PowerShell@2 - name: test - displayName: 'Run Integration Test' + - task: PublishCodeCoverageResults@2 + displayName: 'Publish Code Coverage to Azure DevOps' inputs: - filePath: './build.ps1' - arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0" - pwsh: false + summaryFileLocation: '$(Build.SourcesDirectory)/$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml' + pathToSources: '$(Build.SourcesDirectory)/$(sourceFolderName)/' - - task: PublishTestResults@2 - displayName: 'Publish Test Results' - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '$(buildFolderName)/$(testResultFolderName)/NUnit*.xml' - testRunTitle: 'Integration (Windows Server 2019)' - condition: succeededOrFailed() + - script: | + bash <(curl -s https://codecov.io/bash) -f "./$(buildFolderName)/$(testResultFolderName)/JaCoCo_coverage.xml" + displayName: 'Publish Code Coverage to Codecov.io' - stage: Deploy dependsOn: Test @@ -285,7 +215,7 @@ stages: - job: Deploy_Module displayName: 'Deploy Module' pool: - vmImage: 'ubuntu 16.04' + vmImage: 'ubuntu-latest' steps: - task: DownloadPipelineArtifact@2 displayName: 'Download Pipeline Artifact' From e9a8e98addb77c7a23870d4e48fa5a03bcf25e58 Mon Sep 17 00:00:00 2001 From: Daniel Hughes Date: Tue, 2 Apr 2024 14:24:13 +0100 Subject: [PATCH 5/6] Fix AdcsAuthorityInformationAccess: always makes a change #138 --- CHANGELOG.md | 7 +++++++ .../DSC_AdcsAuthorityInformationAccess.psm1 | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 676eff3..b313239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- AdcsAuthorityInformationAccess + - Removed `AllowRestartService` parameter from compared settings, force `Get-CaAiaUriList` + to return unmangled `System.String[]` with single values. + Fixes [Issue #138](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/138). + ### Changed - ActiveDirectoryCSDsc diff --git a/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 b/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 index 5321e97..5141116 100644 --- a/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 +++ b/source/DSCResources/DSC_AdcsAuthorityInformationAccess/DSC_AdcsAuthorityInformationAccess.psm1 @@ -205,6 +205,7 @@ function Test-TargetResource -Verbose:$VerbosePreference $null = $PSBoundParameters.Remove('IsSingleInstance') + $null = $PSBoundParameters.Remove('AllowRestartService') return Test-DscParameterState ` -CurrentValues $currentSettings ` @@ -234,7 +235,8 @@ function Get-CaAiaUriList Write-Verbose -Message ($script:localizedData.GettingAiaUrisMessage -f $ExtensionType) - return [System.String[]] (Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri + $UriList = [System.String[]](Get-CAAuthorityInformationAccess | Where-Object -Property $ExtensionType -Eq $true).Uri + return ,$UriList } Export-ModuleMember -Function *-TargetResource From 965ad60def89f2e3182b15e8cccc6a501509d944 Mon Sep 17 00:00:00 2001 From: Daniel Hughes Date: Thu, 18 Apr 2024 15:55:23 +0100 Subject: [PATCH 6/6] Add changelog for fixing #128 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b313239..6640ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - AdcsAuthorityInformationAccess - Removed `AllowRestartService` parameter from compared settings, force `Get-CaAiaUriList` to return unmangled `System.String[]` with single values. + Fixes [Issue #128](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/128) Fixes [Issue #138](https://github.com/dsccommunity/ActiveDirectoryCSDsc/issues/138). ### Changed