From 069eab0399ebb756a6c92aadd017bdb548afd6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Andr=C3=A9e=20=5BMSFT=5D?= Date: Thu, 30 Nov 2023 18:34:42 +0100 Subject: [PATCH] Added 'BuildNumber' to 'DscTagging' configuration (#219) * Added 'BuildNumber' * Added BuildNumber to test data --- CHANGELOG.md | 2 +- source/DSCResources/DscTagging/DscTagging.schema.psm1 | 6 +++++- tests/Unit/DSCResources/Assets/Config/DscTagging.yml | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1091ebd..65420c06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fixed bugs in 'DscTagging' +- Fixed bugs in 'DscTagging' and added parameter 'BuildNumber'. ## [0.9.0] - 2023-02-08 diff --git a/source/DSCResources/DscTagging/DscTagging.schema.psm1 b/source/DSCResources/DscTagging/DscTagging.schema.psm1 index 03ed1adb..a2548895 100644 --- a/source/DSCResources/DscTagging/DscTagging.schema.psm1 +++ b/source/DSCResources/DscTagging/DscTagging.schema.psm1 @@ -4,6 +4,10 @@ configuration DscTagging { [System.Version] $Version, + [Parameter()] + [int] + $BuildNumber, + [Parameter(Mandatory = $true)] [string] $Environment, @@ -85,7 +89,7 @@ configuration DscTagging { { Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\DscTagging' ValueName = 'BuildNumber' - ValueData = "$($env:BUILD_BUILDID)" + ValueData = $BuildNumber ValueType = 'String' Ensure = 'Present' Force = $true diff --git a/tests/Unit/DSCResources/Assets/Config/DscTagging.yml b/tests/Unit/DSCResources/Assets/Config/DscTagging.yml index 7fea1bc0..ef9c5cd6 100644 --- a/tests/Unit/DSCResources/Assets/Config/DscTagging.yml +++ b/tests/Unit/DSCResources/Assets/Config/DscTagging.yml @@ -1,5 +1,6 @@ Version: 1.0.0 Environment: Dev +BuildNumber: 100 NodeVersion: NodeRole: FileServer DisableGitCommitId: false