Skip to content

Commit

Permalink
Merge pull request #1417 from PowerShell/dev
Browse files Browse the repository at this point in the history
Release of version 13.1.0.0 of SqlServerDsc
  • Loading branch information
mgreenegit authored Aug 8, 2019
2 parents 601107e + 2337c7c commit 596ff25
Show file tree
Hide file tree
Showing 62 changed files with 5,840 additions and 854 deletions.
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,67 @@

## Unreleased

## 13.1.0.0

- Changes to SqlServerDsc
- New DSC resource SqlAgentFailsafe
- New DSC resource SqlDatabaseUser ([issue #846](https://github.com/PowerShell/SqlServerDsc/issues/846)).
- Adds ability to create database users with more fine-grained control,
e.g. re-mapping of orphaned logins or a different login. Supports
creating a user with or without login name, and database users mapped
to a certificate or asymmetric key.
- Changes to helper function Invoke-Query
- Fixes issues in [issue #1355](https://github.com/PowerShell/SqlServerDsc/issues/1355).
- Works together with Connect-SQL now.
- Parameters now match that of Connect-SQL ([issue #1392](https://github.com/PowerShell/SqlServerDsc/issues/1392)).
- Can now pass in credentials.
- Can now pass in 'Microsoft.SqlServer.Management.Smo.Server' object.
- Can also pipe in 'Microsoft.SqlServer.Management.Smo.Server' object.
- Can pipe Connect-SQL | Invoke-Query.
- Added default values to Invoke-Query.
- Now it will output verbose messages of the query that is run, so it
not as quiet of what it is doing when a user asks for verbose output
([issue #1404](https://github.com/PowerShell/SqlServerDsc/issues/1404)).
- It is possible to redact text in the verbose output by providing
strings in the new parameter `RedactText`.
- Minor style fixes in unit tests.
- Changes to helper function Connect-SQL
- When impersonating WindowsUser credential use the NetworkCredential UserName.
- Added additional verbose logging.
- Connect-SQL now uses parameter sets to more intuitive evaluate that
the correct parameters are used in different scenarios
([issue #1403](https://github.com/PowerShell/SqlServerDsc/issues/1403)).
- Changes to helper function Connect-SQLAnalysis
- Parameters now match that of Connect-SQL ([issue #1392](https://github.com/PowerShell/SqlServerDsc/issues/1392)).
- Changes to helper function Restart-SqlService
- Parameters now match that of Connect-SQL ([issue #1392](https://github.com/PowerShell/SqlServerDsc/issues/1392)).
- Changes to helper function Restart-ReportingServicesService
- Parameters now match that of Connect-SQL ([issue #1392](https://github.com/PowerShell/SqlServerDsc/issues/1392)).
- Changes to helper function Split-FullSqlInstanceName
- Parameters and function name changed to use correct casing.
- Changes to helper function Get-SqlInstanceMajorVersion
- Parameters now match that of Connect-SQL ([issue #1392](https://github.com/PowerShell/SqlServerDsc/issues/1392)).
- Changes to helper function Test-LoginEffectivePermissions
- Parameters now match that of Connect-SQL ([issue #1392](https://github.com/PowerShell/SqlServerDsc/issues/1392)).
- Changes to helper function Test-AvailabilityReplicaSeedingModeAutomatic
- Parameters now match that of Connect-SQL ([issue #1392](https://github.com/PowerShell/SqlServerDsc/issues/1392)).
- Changes to SqlServerSecureConnection
- Forced $Thumbprint to lowercase to fix [issue #1350](https://github.com/PowerShell/SqlServerDsc/issues/1350).
- Add parameter SuppressRestart with default value false.
This allows users to suppress restarts after changes have been made.
Changes will not take effect until the service has been restarted.
- Changes to SqlSetup
- Correct minor style violation [issue #1387](https://github.com/PowerShell/SqlServerDsc/issues/1387).
- Changes to SqlDatabase
- Get-TargetResource now correctly return `$null` for the collation property
when the database does not exist ([issue #1395](https://github.com/PowerShell/SqlServerDsc/issues/1395)).
- No longer enforces the collation property if the Collation parameter
is not part of the configuration ([issue #1396](https://github.com/PowerShell/SqlServerDsc/issues/1396)).
- Updated resource description in README.md
- Fix examples to use `PsDscRunAsCredential` ([issue #760](https://github.com/PowerShell/SqlServerDsc/issues/760)).
- Added integration tests ([issue #739](https://github.com/PowerShell/SqlServerDsc/issues/739)).
- Updated unit tests to the latest template ([issue #1068](https://github.com/PowerShell/SqlServerDsc/issues/1068)).

## 13.0.0.0

- Changes to SqlServerDsc
Expand Down
16 changes: 8 additions & 8 deletions DSCResources/MSFT_SqlAGDatabase/MSFT_SqlAGDatabase.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ function Set-TargetResource
$availabilityReplicaFilestreamLevel = @{}
foreach ( $availabilityGroupReplica in $secondaryReplicas )
{
$connectSqlParameters = Split-FullSQLInstanceName -FullSQLInstanceName $availabilityGroupReplica.Name
$connectSqlParameters = Split-FullSqlInstanceName -FullSqlInstanceName $availabilityGroupReplica.Name
$currentAvailabilityGroupReplicaServerObject = Connect-SQL @connectSqlParameters
$availabilityReplicaFilestreamLevel.Add($availabilityGroupReplica.Name, $currentAvailabilityGroupReplicaServerObject.FilestreamLevel)
}
Expand All @@ -334,7 +334,7 @@ function Set-TargetResource
$availabilityReplicaContainmentEnabled = @{}
foreach ( $availabilityGroupReplica in $secondaryReplicas )
{
$connectSqlParameters = Split-FullSQLInstanceName -FullSQLInstanceName $availabilityGroupReplica.Name
$connectSqlParameters = Split-FullSqlInstanceName -FullSqlInstanceName $availabilityGroupReplica.Name
$currentAvailabilityGroupReplicaServerObject = Connect-SQL @connectSqlParameters
$availabilityReplicaContainmentEnabled.Add($availabilityGroupReplica.Name, $currentAvailabilityGroupReplicaServerObject.Configuration.ContainmentEnabled.ConfigValue)
}
Expand All @@ -355,14 +355,14 @@ function Set-TargetResource
$availabilityReplicaMissingDirectories = @{}
foreach ( $availabilityGroupReplica in $secondaryReplicas )
{
$connectSqlParameters = Split-FullSQLInstanceName -FullSQLInstanceName $availabilityGroupReplica.Name
$connectSqlParameters = Split-FullSqlInstanceName -FullSqlInstanceName $availabilityGroupReplica.Name
$currentAvailabilityGroupReplicaServerObject = Connect-SQL @connectSqlParameters

$missingDirectories = @()
foreach ( $databaseFileDirectory in $databaseFileDirectories )
{
$fileExistsQuery = "EXEC master.dbo.xp_fileexist '$databaseFileDirectory'"
$fileExistsResult = Invoke-Query -SQLServer $currentAvailabilityGroupReplicaServerObject.NetName -SQLInstanceName $currentAvailabilityGroupReplicaServerObject.ServiceName -Database master -Query $fileExistsQuery -WithResults
$fileExistsResult = Invoke-Query -ServerName $currentAvailabilityGroupReplicaServerObject.NetName -InstanceName $currentAvailabilityGroupReplicaServerObject.ServiceName -Database master -Query $fileExistsQuery -WithResults

if ( $fileExistsResult.Tables.Rows.'File is a Directory' -ne 1 )
{
Expand Down Expand Up @@ -393,7 +393,7 @@ function Set-TargetResource
$availabilityReplicaMissingCertificates = @{}
foreach ( $availabilityGroupReplica in $secondaryReplicas )
{
$connectSqlParameters = Split-FullSQLInstanceName -FullSQLInstanceName $availabilityGroupReplica.Name
$connectSqlParameters = Split-FullSqlInstanceName -FullSqlInstanceName $availabilityGroupReplica.Name
$currentAvailabilityGroupReplicaServerObject = Connect-SQL @connectSqlParameters
[System.Array]$installedCertificateThumbprints = $currentAvailabilityGroupReplicaServerObject.Databases['master'].Certificates | ForEach-Object { [System.BitConverter]::ToString($_.Thumbprint) }

Expand Down Expand Up @@ -540,13 +540,13 @@ function Set-TargetResource
foreach ( $availabilityGroupReplica in $secondaryReplicas )
{
# Connect to the replica
$connectSqlParameters = Split-FullSQLInstanceName -FullSQLInstanceName $availabilityGroupReplica.Name
$connectSqlParameters = Split-FullSqlInstanceName -FullSqlInstanceName $availabilityGroupReplica.Name
$currentAvailabilityGroupReplicaServerObject = Connect-SQL @connectSqlParameters
$currentReplicaAvailabilityGroupObject = $currentAvailabilityGroupReplicaServerObject.AvailabilityGroups[$AvailabilityGroupName]

# Restore the database
Invoke-Query -SQLServer $currentAvailabilityGroupReplicaServerObject.NetName -SQLInstanceName $currentAvailabilityGroupReplicaServerObject.ServiceName -Database master -Query $restoreDatabaseQueryString -StatementTimeout 0
Invoke-Query -SQLServer $currentAvailabilityGroupReplicaServerObject.NetName -SQLInstanceName $currentAvailabilityGroupReplicaServerObject.ServiceName -Database master -Query $restoreLogQueryString -StatementTimeout 0
Invoke-Query -ServerName $currentAvailabilityGroupReplicaServerObject.NetName -InstanceName $currentAvailabilityGroupReplicaServerObject.ServiceName -Database master -Query $restoreDatabaseQueryString -StatementTimeout 0
Invoke-Query -ServerName $currentAvailabilityGroupReplicaServerObject.NetName -InstanceName $currentAvailabilityGroupReplicaServerObject.ServiceName -Database master -Query $restoreLogQueryString -StatementTimeout 0

# Add the database to the Availability Group
Add-SqlAvailabilityDatabase -InputObject $currentReplicaAvailabilityGroupObject -Database $databaseToAddToAvailabilityGroup
Expand Down
Loading

0 comments on commit 596ff25

Please sign in to comment.