Skip to content

Commit 918557f

Browse files
authored
New-SqlDscRole: Fix verbose output (#2359)
1 parent 78ece95 commit 918557f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3838
- Fixed parameter types for boolean database properties from `System.Boolean` to
3939
`System.Management.Automation.SwitchParameter` to follow PowerShell best practices.
4040
([issue #2190](https://github.com/dsccommunity/SqlServerDsc/issues/2190)).
41+
- `New-SqlDscRole`
42+
- Fixed duplicate verbose output by removing manual `Write-Verbose` call, as
43+
`$PSCmdlet.ShouldProcess()` already generates appropriate verbose output
44+
([issue #2156](https://github.com/dsccommunity/SqlServerDsc/issues/2156)).
4145
- `Set-SqlDscDatabaseProperty`
4246
- Fixed parameter types for database-scoped configuration properties from
4347
`System.Boolean` to `Microsoft.SqlServer.Management.Smo.DatabaseScopedConfigurationOnOff`

source/Public/New-SqlDscRole.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ function New-SqlDscRole
9393
$ServerObject.Roles.Refresh()
9494
}
9595

96-
Write-Verbose -Message ($script:localizedData.Role_Create -f $Name, $ServerObject.InstanceName)
97-
9896
# Check if the role already exists
9997
if ($ServerObject.Roles[$Name])
10098
{

source/en-US/SqlServerDsc.strings.psd1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ ConvertFrom-StringData @'
317317
Get_SqlDscRole_NotFound = Server role '{0}' was not found. (GSDR0001)
318318
319319
## New-SqlDscRole
320-
Role_Create = Creating server role '{0}' on instance '{1}'.
321320
Role_CreateFailed = Failed to create server role '{0}' on instance '{1}'.
322321
Role_AlreadyExists = Server role '{0}' already exists on instance '{1}'.
323322
Role_Create_ShouldProcessDescription = Creating the server role '{0}' on the instance '{1}'.

0 commit comments

Comments
 (0)