Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlLogin: Attempting to disable and already disabled login throws an error #1952 #1953

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SqlWindowsFirewall
- Fix duplication of SQL Server Browser Firewall Rule when deploying
Analysis Services feature ([issue #1942](https://github.com/dsccommunity/SqlServerDsc/issues/1942)).
- SqlLogin
- Attempting to disable and already disabled login throws an error ([issue #1952](https://github.com/dsccommunity/SqlServerDsc/issues/1952))

## [16.3.1] - 2023-05-06

Expand Down
4 changes: 2 additions & 2 deletions source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ function Connect-SQL
$newObjectParameters = @{
TypeName = 'System.Management.Automation.ErrorRecord'
ArgumentList = @(
$invalidOperationException.ToString(),
$invalidOperationException,
'CS0001',
'InvalidOperation',
$databaseEngineInstance
Expand All @@ -642,7 +642,7 @@ function Connect-SQL
$newObjectParameters = @{
TypeName = 'System.Management.Automation.ErrorRecord'
ArgumentList = @(
$invalidOperationException.ToString(),
$invalidOperationException,
'CS0002',
'InvalidOperation',
$databaseEngineInstance
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/SqlServerDsc.Common.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ Describe 'SqlServerDsc.Common\Connect-SQL' -Tag 'ConnectSql' {
$mockErrorMessage = $mockLocalizedString -f 'localhost'

{ Connect-SQL -ServerName 'localhost' -ErrorAction 'Stop' } |
Should -Throw -ExpectedMessage ('System.InvalidOperationException: {0}*' -f $mockErrorMessage)
Should -Throw -ExpectedMessage $mockErrorMessage

Should -Invoke -CommandName New-Object -ParameterFilter {
$TypeName -eq 'Microsoft.SqlServer.Management.Smo.Server'
Expand Down