Skip to content

Commit

Permalink
Merge branch 'main' into connect-sql-destring-exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored Aug 19, 2023
2 parents f969e6b + e52f4a5 commit c8bbf70
Show file tree
Hide file tree
Showing 19 changed files with 124 additions and 86 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bumped dbatools to v2.0.1 for the integration tests.
- Running PSScriptAnalyzer on the built module ([issue #1945](https://github.com/dsccommunity/SqlServerDsc/issues/1945)).
- Fix header in unit tests that referenced the wrong path.
- Fix a path in VS Code workspace settings to correctly use Script Analyzer on Linux and macOS.
- Fix a path in VS Code workspace settings to correctly use Script Analyzer on
Linux and macOS.
- Highlighted note comments throughout markdown and generated markdown.
- SqlSetup
- Highlighted a note in the README.md.
- SqlMemory
- Highlighted an important note in the README.md.
- SqlMaxDop
- Highlighted an important note in the README.md.

### Fixed

Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ not be used, neither shall the command `Write-Error` with the parameter
to throw a terminating error. The exception is when a `[ValidateScript()]`
has to throw an error, then `throw` must be used.

>**NOTE:** Below output assumes `$ErrorView` is set to `'NormalView'` in the
>PowerShell session.
> [!NOTE]
> Below output assumes `$ErrorView` is set to `'NormalView'` in the
> PowerShell session.
When using `throw` it will fail on the line with the throw statement
making it look like it is that statement inside the function that failed,
Expand Down
7 changes: 4 additions & 3 deletions source/Classes/020.SqlDatabasePermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
permissions for a user in a database. For more information about permissions,
please read the article [Permissions (Database Engine)](https://docs.microsoft.com/en-us/sql/relational-databases/security/permissions-database-engine).
>**Note:** When revoking permission with PermissionState 'GrantWithGrant', both the
>grantee and _all the other users the grantee has granted the same permission to_,
>will also get their permission revoked.
> [!NOTE]
> When revoking permission with PermissionState 'GrantWithGrant', both the
> grantee and _all the other users the grantee has granted the same permission_
> _to_, will also get their permission revoked.
## Requirements
Expand Down
7 changes: 4 additions & 3 deletions source/Classes/020.SqlPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
Server permissions for a login. For more information about permissions,
please read the article [Permissions (Database Engine)](https://docs.microsoft.com/en-us/sql/relational-databases/security/permissions-database-engine).
>**Note:** When revoking permission with PermissionState 'GrantWithGrant', both the
>grantee and _all the other users the grantee has granted the same permission to_,
>will also get their permission revoked.
> [!NOTE]
> When revoking permission with PermissionState 'GrantWithGrant', both the
> grantee and _all the other users the grantee has granted the same permission_
> _to_, will also get their permission revoked.
## Requirements
Expand Down
3 changes: 2 additions & 1 deletion source/DSCResources/DSC_SqlDatabaseMail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

The `SqlDatabaseMail` DSC resource manages SQL Server Database Mail.

>**Note:** Database Mail XPs can be enabled using the resource `SqlConfiguration`.
> [!NOTE]
> Database Mail XPs can be enabled using the resource `SqlConfiguration`.
## Requirements

Expand Down
7 changes: 4 additions & 3 deletions source/DSCResources/DSC_SqlDatabaseObjectPermission/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ of database objects in a database for a SQL Server instance.
For more information about permission names that can be managed, see the
property names of the [ObjectPermissionSet](https://docs.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.management.smo.objectpermissionset#properties) class.

>**Note:** When revoking permission with PermissionState 'GrantWithGrant', both the
>grantee and _all the other users the grantee has granted the same permission to_,
>will also get their permission revoked.
> [!NOTE]
> When revoking permission with PermissionState 'GrantWithGrant', both the
> grantee and _all the other users the grantee has granted the same permission to_,
> will also get their permission revoked.
## Requirements

Expand Down
3 changes: 2 additions & 1 deletion source/DSCResources/DSC_SqlDatabaseUser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ user can be mapped to a certificate or asymmetric key. The resource also
allows re-mapping of the SQL login. If the targeted database is not updatable,
the resource returns true.

> **Note:** This resource does not yet support [Contained Databases](https://docs.microsoft.com/en-us/sql/relational-databases/databases/contained-databases).
> [!NOTE]
> This resource does not yet support [Contained Databases](https://docs.microsoft.com/en-us/sql/relational-databases/databases/contained-databases).
## Requirements

Expand Down
9 changes: 5 additions & 4 deletions source/DSCResources/DSC_SqlEndpoint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ The `SqlEndpoint` DSC resource is used to create an endpoint. Currently
it only supports creating a database mirror and a service broker endpoint. A database mirror
endpoint can be used by AlwaysOn.

>Note: The endpoint will be started after creation, but will not be enforced
>unless the the parameter `State` is specified.
>To set connect permission to the endpoint, please use
>the resource [**SqlEndpointPermission**](#sqlendpointpermission).
> [!NOTE]
> The endpoint will be started after creation, but will not be enforced
> unless the the parameter `State` is specified.
> To set connect permission to the endpoint, please use
> the resource [**SqlEndpointPermission**](#sqlendpointpermission).
## Requirements

Expand Down
9 changes: 5 additions & 4 deletions source/DSCResources/DSC_SqlMaxDop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ the number of processors to use in parallel plan execution. Read more about
max degree of parallelism in this article
[Configure the max degree of parallelism Server Configuration Option](https://msdn.microsoft.com/en-us/library/ms189094.aspx)

>**NOTE** This configuration option can also be configured using the DSC
>resource _SqlConfiguration_ but will not allow the dynamic configuration
>as this resource provides. Make sure this value is not configured by both
>the resources _SqLMaxDop_ and _SqlConfiguration_!
> [!IMPORTANT]
> This configuration option can also be configured using the DSC
> resource _SqlConfiguration_ but will not allow the dynamic configuration
> as this resource provides. Make sure this value is not configured by both
> the resources _SqLMaxDop_ and _SqlConfiguration_!
## Formula for dynamically allocating max degree of parallelism

Expand Down
9 changes: 5 additions & 4 deletions source/DSCResources/DSC_SqlMemory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ and the default setting for maximum server memory is 2147483647 MB. Read
more about minimum server memory and maximum server memory in this article
[Server Memory Server Configuration Options](https://msdn.microsoft.com/en-us/library/ms178067.aspx).

>**NOTE** These configuration options can also be configured using the DSC
>resource _SqlConfiguration_ but will not allow the dynamic configuration
>as this resource provides. Make sure this value is not configured by both
>the resources _SqLMemory_ and _SqlConfiguration_!
> [!IMPORTANT]
> These configuration options can also be configured using the DSC
> resource _SqlConfiguration_ but will not allow the dynamic configuration
> as this resource provides. Make sure this value is not configured by both
> the resources _SqLMemory_ and _SqlConfiguration_!
## Formula for dynamically allocating maximum memory

Expand Down
25 changes: 13 additions & 12 deletions source/DSCResources/DSC_SqlRSSetup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ used, then the installation will run as SYSTEM.
is successful (because the executable returns exit code 0) but the
Microsoft SQL Server Reporting Services instance was not actually removed.

>NOTE: When using the action 'Uninstall' and the target node to begin with
>requires a restart, on the first run the Microsoft SQL Server Reporting
>Services instance will not be uninstalled, but instead exits with code
>3010 and the node will be, by default, restarted. On the second run after
>restart, the Microsoft SQL Server Reporting Services instance will be
>uninstalled. If the parameter SuppressRestart is used, then the node must
>be restarted manually before the Microsoft SQL Server Reporting Services
>instance will be successfully uninstalled.
> [!NOTE]
> When using the action 'Uninstall' and the target node to begin with
> requires a restart, on the first run the Microsoft SQL Server Reporting
> Services instance will not be uninstalled, but instead exits with code
> 3010 and the node will be, by default, restarted. On the second run after
> restart, the Microsoft SQL Server Reporting Services instance will be
> uninstalled. If the parameter SuppressRestart is used, then the node must
> be restarted manually before the Microsoft SQL Server Reporting Services
> instance will be successfully uninstalled.
>
>The Microsoft SQL Server Reporting Services log will indicate that a
>restart is required by outputting; "*No action was taken as a system
>reboot is required (0x8007015E)*". The log is default located in the
>SSRS folder in `%TEMP%`, e.g. `C:\Users\<user>\AppData\Local\Temp\SSRS`.
> The Microsoft SQL Server Reporting Services log will indicate that a
> restart is required by outputting; "*No action was taken as a system
> reboot is required (0x8007015E)*". The log is default located in the
> SSRS folder in `%TEMP%`, e.g. `C:\Users\<user>\AppData\Local\Temp\SSRS`.
## Known issues

Expand Down
7 changes: 4 additions & 3 deletions source/DSCResources/DSC_SqlSecureConnection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ The `SqlSecureConnection` DSC resource configures SQL connections
to be encrypted. Read more about encrypted connections in this article
[Enable Encrypted Connections](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/enable-encrypted-connections-to-the-database-engine).

>**Note:** The 'LocalSystem' service account will return a connection
>error, even though the connection has been successful. In that case,
>the 'SYSTEM' service account can be used.
> [!NOTE]
> The 'LocalSystem' service account will return a connection
> error, even though the connection has been successful. In that case,
> the 'SYSTEM' service account can be used.
## Requirements

Expand Down
2 changes: 1 addition & 1 deletion source/DSCResources/DSC_SqlSetup/DSC_SqlSetup.schema.mof
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ClassVersion("1.0.0.0"), FriendlyName("SqlSetup")]
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 action to be performed. Default value is `'Install'`. <br />> [!NOTE] **AddNode is not currently functional.**"), ValueMap{"Install","Upgrade","InstallFailoverCluster","AddNode","PrepareFailoverCluster","CompleteFailoverCluster"}, Values{"Install","Upgrade","InstallFailoverCluster","AddNode","PrepareFailoverCluster","CompleteFailoverCluster"}] String Action;
[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;
Expand Down
14 changes: 8 additions & 6 deletions source/DSCResources/DSC_SqlSetup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ available on all versions of _SQL Server_.
- SSMS
- ADV_SSMS

> **Note:** It is not possible to add or remove features to a SQL Server failover
>cluster. This is a limitation of SQL Server. See article
>[You cannot add or remove features to a SQL Server 2008, SQL Server 2008 R2, or
>SQL Server 2012 failover cluster](https://support.microsoft.com/en-us/help/2547273/you-cannot-add-or-remove-features-to-a-sql-server-2008,-sql-server-2008-r2,-or-sql-server-2012-failover-cluster).
> [!NOTE]
> It is not possible to add or remove features to a SQL Server failover
> cluster. This is a limitation of SQL Server. See article
> [You cannot add or remove features to a SQL Server 2008, SQL Server 2008 R2, or
> SQL Server 2012 failover cluster](https://support.microsoft.com/en-us/help/2547273/you-cannot-add-or-remove-features-to-a-sql-server-2008,-sql-server-2008-r2,-or-sql-server-2012-failover-cluster).
## Skip rules

Expand Down Expand Up @@ -141,8 +142,9 @@ Feature flags are used to toggle resource functionality on or off. One or
more feature flags can be added to the parameter `FeatureFlag`, i.e.
`FeatureFlag = @('DetectionSharedFeatures')`.

>**NOTE:** The functionality, exposed with a feature flag, can be changed
>from one release to another, including having breaking changes.
> [!NOTE]
> The functionality, exposed with a feature flag, can be changed
> from one release to another, including having breaking changes.
<!-- markdownlint-disable MD013 -->
Feature flag | Description
Expand Down
20 changes: 12 additions & 8 deletions source/Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ changed to match your configuration. Also, please see other resource examples in
[xFailOverCluster](https://github.com/PowerShell/xFailOverCluster) to see if
they could improve you configuration, for example the resource xClusterQuorum.

>**Note:** Make sure any user accounts you use in the configuration exist in
>Active Directory and that they have the correct permission.
> [!NOTE]
> Make sure any user accounts you use in the configuration exist in
> Active Directory and that they have the correct permission.
#### Install SQL Server Failover Cluster Instance

Expand All @@ -150,8 +151,9 @@ The example shows how to
And this example shows how to
[install the second SQL Server Failover Cluster node for a named instance](https://github.com/PowerShell/SqlServerDsc/blob/dev/Examples/Resources/SqlSetup/5-InstallNamedInstanceInFailoverClusterSecondNode.ps1).

>**Note:** Make sure any user accounts you use in the configuration exist in
>Active Directory and that they have the correct permission.
> [!NOTE]
> Make sure any user accounts you use in the configuration exist in
> Active Directory and that they have the correct permission.
## Setting up a SQL Server AlwaysOn Availability Groups

Expand All @@ -172,8 +174,9 @@ to the failover cluster needed for SQL Server AlwaysOn Availability Groups.

#### Install SQL Server on replicas

>**Note:** Make sure any user accounts you use in the configuration exist in
>Active Directory and that they have the correct permission.
> [!NOTE]
> Make sure any user accounts you use in the configuration exist in
> Active Directory and that they have the correct permission.
##### Install SQL Server on the primary node

Expand Down Expand Up @@ -202,5 +205,6 @@ Once AlwaysOn is enabled we can create the Availability Group. The example [Crea
shows how to create the Availability Group on the primary replica and join the
Availability Group on the secondary replica.

>**Note:** Make sure any user accounts you use in the configuration exist in
>Active Directory and that they have the correct permission.
> [!NOTE]
> Make sure any user accounts you use in the configuration exist in
> Active Directory and that they have the correct permission.
3 changes: 2 additions & 1 deletion source/Examples/Resources/SqlRS/2-CustomConfiguration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
http://localhost:80/MyReports
https://localhost:443/MyReports
Note: this resource does not currently handle SSL bindings for HTTPS endpoints.
> [!NOTE]
> This resource does not currently handle SSL bindings for HTTPS endpoints.
#>
Configuration Example
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
Report Server Web Service: https://localhost:443/MyReportServer ()
Report Manager: https://localhost:443/MyReports
Note: this resource does not currently handle SSL bindings for HTTPS endpoints.
> [!NOTE]
> This resource does not currently handle SSL bindings for HTTPS endpoints.
#>
Configuration Example
{
Expand Down
5 changes: 3 additions & 2 deletions source/WikiSource/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ machine-wide, or at minimum set for each user that runs DSC resources, on
the target node. Make sure you comply with any license terms that is part
of dbatools.

>**NOTE:** It is also possible to use any module as a preferred module if
>its name is set as the value of the environment variable `SMODefaultModuleName`.
> [!NOTE]
> It is also possible to use any module as a preferred module if
> its name is set as the value of the environment variable `SMODefaultModuleName`.
## Change log

Expand Down
Loading

0 comments on commit c8bbf70

Please sign in to comment.