From 344ac4484e79c9f0328b67d1d300d63592669f8f Mon Sep 17 00:00:00 2001 From: John <31294925+jrdbarnes@users.noreply.github.com> Date: Wed, 8 Jun 2022 16:25:12 +0100 Subject: [PATCH] SqlSetup: SourcePath should be a mandatory parameter (#1756) - The `SourcePath` parameter is now mandatory for all `*-TargetResource` (issue #1755). --- CHANGELOG.md | 2 ++ source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 | 6 +++--- source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.schema.mof | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac45d44a..729ab0ad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -185,6 +185,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 that was not available. - The loop that evaluates what features are installed did an unnecessary step for each iteration. A line of code was moved outside of the loop. + - The `SourcePath` parameter is now mandatory for all `*-TargetResource` + ([issue #1755](https://github.com/dsccommunity/SqlServerDsc/issues/1755)). ## [15.2.0] - 2021-09-01 diff --git a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 index fbb95c740..f06b83045 100644 --- a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 +++ b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.psm1 @@ -58,7 +58,7 @@ function Get-TargetResource [System.String] $Action = 'Install', - [Parameter()] + [Parameter(Mandatory = $true)] [System.String] $SourcePath, @@ -663,7 +663,7 @@ function Set-TargetResource [System.String] $Action = 'Install', - [Parameter()] + [Parameter(Mandatory = $true)] [System.String] $SourcePath, @@ -1875,7 +1875,7 @@ function Test-TargetResource [System.String] $Action = 'Install', - [Parameter()] + [Parameter(Mandatory = $true)] [System.String] $SourcePath, diff --git a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.schema.mof b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.schema.mof index 1b93c16af..3580cdeec 100644 --- a/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.schema.mof +++ b/source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.schema.mof @@ -2,7 +2,7 @@ class DSC_SqlSetup : OMI_BaseResource { [Write, Description("The action to be performed. Default value is `'Install'`. **NOTE: AddNode is not currently functional.**"), ValueMap{"Install","Upgrade","InstallFailoverCluster","AddNode","PrepareFailoverCluster","CompleteFailoverCluster"}, Values{"Install","Upgrade","InstallFailoverCluster","AddNode","PrepareFailoverCluster","CompleteFailoverCluster"}] String Action; - [Write, Description("The path to the root of the source files for installation. I.e and UNC path to a shared resource. Environment variables can be used in the path.")] String SourcePath; + [Required, Description("The path to the root of the source files for installation. I.e and UNC path to a shared resource. Environment variables can be used in the path.")] String SourcePath; [Write, EmbeddedInstance("MSFT_Credential"), Description("Credentials used to access the path set in the parameter **SourcePath**. See section [Considerations](#considerations) regarding the parameter **SourceCredential**.")] String SourceCredential; [Write, Description("Suppresses reboot.")] Boolean SuppressReboot; [Write, Description("Forces reboot.")] Boolean ForceReboot;