From 7a4620d5d286b54632c093f8135918bf719e51fd Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sun, 12 Feb 2023 16:47:52 +0100 Subject: [PATCH] `Uninstall-SqlDscServer`: Now support argument `SuppressPrivacyStatementNotice` (#1851) - `Uninstall-SqlDscServer` - Now support the argument `SuppressPrivacyStatementNotice` (issue #1809). --- CHANGELOG.md | 1 + source/Public/Uninstall-SqlDscServer.ps1 | 9 ++++++++- tests/Unit/Public/Uninstall-SqlDscServer.Tests.ps1 | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 508246301..72ef636a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,6 +149,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `Uninstall-SqlDscServer` - Was changed to support the SQL Server 2022 GA feature `AzureExtension` (that replaced the feature name `ARC`) ([issue #1798](https://github.com/dsccommunity/SqlServerDsc/issues/1798)). + - Now support the argument `SuppressPrivacyStatementNotice` ([issue #1809](https://github.com/dsccommunity/SqlServerDsc/issues/1809)). - `Import-SqlDscPreferredModule` - No longer tries to get the environment variables from the machine state when run on Linux or macOS. This will allow the unit tests to run diff --git a/source/Public/Uninstall-SqlDscServer.ps1 b/source/Public/Uninstall-SqlDscServer.ps1 index 4085086db..bb336d42c 100644 --- a/source/Public/Uninstall-SqlDscServer.ps1 +++ b/source/Public/Uninstall-SqlDscServer.ps1 @@ -28,6 +28,9 @@ .PARAMETER Features See the notes section for more information. + .PARAMETER SuppressPrivacyStatementNotice + See the notes section for more information. + .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt @@ -104,7 +107,11 @@ function Uninstall-SqlDscServer [Parameter()] [System.Management.Automation.SwitchParameter] - $Force + $Force, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $SuppressPrivacyStatementNotice ) Invoke-SetupAction -Uninstall @PSBoundParameters -ErrorAction 'Stop' diff --git a/tests/Unit/Public/Uninstall-SqlDscServer.Tests.ps1 b/tests/Unit/Public/Uninstall-SqlDscServer.Tests.ps1 index 122520127..207767741 100644 --- a/tests/Unit/Public/Uninstall-SqlDscServer.Tests.ps1 +++ b/tests/Unit/Public/Uninstall-SqlDscServer.Tests.ps1 @@ -52,7 +52,7 @@ Describe 'Uninstall-SqlDscServer' -Tag 'Public' { @{ MockParameterSetName = '__AllParameterSets' # cSpell: disable-next - MockExpectedParameters = '[-MediaPath] [-InstanceName] [[-Features] ] [[-Timeout] ] [-Force] [-WhatIf] [-Confirm] []' + MockExpectedParameters = '[-MediaPath] [-InstanceName] [[-Features] ] [[-Timeout] ] [-Force] [-SuppressPrivacyStatementNotice] [-WhatIf] [-Confirm] []' } ) { $result = (Get-Command -Name 'Uninstall-SqlDscServer').ParameterSets |