diff --git a/.github/instructions/dsc-community-style-guidelines-powershell.instructions.md b/.github/instructions/dsc-community-style-guidelines-powershell.instructions.md index 4360eab6f8..c7a2e93536 100644 --- a/.github/instructions/dsc-community-style-guidelines-powershell.instructions.md +++ b/.github/instructions/dsc-community-style-guidelines-powershell.instructions.md @@ -64,8 +64,8 @@ applyTo: "{**/*.ps1,**/*.psm1,**/*.psd1}" - Comment-based help: SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, EXAMPLE sections before function/class - Comment-based help indentation: keywords 4 spaces, text 8 spaces - Include examples for all parameter sets and combinations -- INPUTS: List each pipeline‑accepted type (one per line) with a 1‑line description. Repeat keyword for each input type. -- OUTPUTS: List each return type (one per line) with a 1‑line description. Repeat keyword for each output type. Must match both `[OutputType()]` and actual returns. +- INPUTS: List each pipeline‑accepted type as inline code with a 1‑line description. Repeat keyword for each input type. If there are no inputs, specify `None.`. +- OUTPUTS: List each return type as inline code with a 1‑line description. Repeat keyword for each output type. Must match both `[OutputType()]` and actual returns. If there are no outputs, specify `None.`. - .NOTES: Include only if it conveys critical info (constraints, side effects, security, version compatibility, breaking behavior). Keep to ≤2 short sentences. ## Functions diff --git a/CHANGELOG.md b/CHANGELOG.md index 91be06b0f8..466a0c4426 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Updated comment-based help `.INPUTS` and `.OUTPUTS` sections across all public + commands and private functions to comply with DSC community style guidelines + ([issue #2103](https://github.com/dsccommunity/SqlServerDsc/issues/2103)). - `Set-SqlDscDatabaseProperty` - Updated comment-based help to reference correct enum values. - Added SQL Server version requirements to version-specific parameter help. diff --git a/source/Private/Assert-Feature.ps1 b/source/Private/Assert-Feature.ps1 index 7ea8b71b8d..a8084d8d4a 100644 --- a/source/Private/Assert-Feature.ps1 +++ b/source/Private/Assert-Feature.ps1 @@ -17,6 +17,11 @@ Throws an exception if the feature is not supported. + .INPUTS + `System.String[]` + + Accepts an array of feature names via the pipeline. + .OUTPUTS None. #> diff --git a/source/Private/Assert-ManagedServiceType.ps1 b/source/Private/Assert-ManagedServiceType.ps1 index 9c5d131c63..b3ce780180 100644 --- a/source/Private/Assert-ManagedServiceType.ps1 +++ b/source/Private/Assert-ManagedServiceType.ps1 @@ -24,6 +24,11 @@ Asserts that the computer managed service object is of the type Database Engine. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.Service` + + Accepts a SQL Server managed service object via the pipeline. + .OUTPUTS None. #> diff --git a/source/Private/Assert-SetupActionProperties.ps1 b/source/Private/Assert-SetupActionProperties.ps1 index dd005ef7a0..19aa730863 100644 --- a/source/Private/Assert-SetupActionProperties.ps1 +++ b/source/Private/Assert-SetupActionProperties.ps1 @@ -17,6 +17,9 @@ Throws an exception if the bound parameters are not in the correct state. + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Private/ConvertFrom-ManagedServiceType.ps1 b/source/Private/ConvertFrom-ManagedServiceType.ps1 index 2da1f68c90..fce66393b6 100644 --- a/source/Private/ConvertFrom-ManagedServiceType.ps1 +++ b/source/Private/ConvertFrom-ManagedServiceType.ps1 @@ -14,6 +14,16 @@ ConvertFrom-ManagedServiceType -ServiceType 'SqlServer' Returns the normalized service type name 'DatabaseEngine' . + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.ManagedServiceType` + + Accepts a managed service type via the pipeline. + + .OUTPUTS + `System.String` + + Returns the normalized service type name. #> function ConvertFrom-ManagedServiceType { diff --git a/source/Private/ConvertTo-AuditNewParameterSet.ps1 b/source/Private/ConvertTo-AuditNewParameterSet.ps1 index dc09076fa3..fc94da2034 100644 --- a/source/Private/ConvertTo-AuditNewParameterSet.ps1 +++ b/source/Private/ConvertTo-AuditNewParameterSet.ps1 @@ -28,12 +28,10 @@ Converts an existing audit object to a parameter set with a custom GUID. .INPUTS - None - - This function does not accept pipeline input. + None. .OUTPUTS - System.Collections.Hashtable + `System.Collections.Hashtable` Returns a hashtable of parameters for New-SqlDscAudit. #> diff --git a/source/Private/ConvertTo-FormattedParameterDescription.ps1 b/source/Private/ConvertTo-FormattedParameterDescription.ps1 index d9c7d50dd2..3d1292c3fa 100644 --- a/source/Private/ConvertTo-FormattedParameterDescription.ps1 +++ b/source/Private/ConvertTo-FormattedParameterDescription.ps1 @@ -13,8 +13,11 @@ .PARAMETER Exclude Array of parameter names to exclude from the formatted output. + .INPUTS + None. + .OUTPUTS - System.String + `System.String` Returns a formatted string with parameters and their values. diff --git a/source/Private/ConvertTo-ManagedServiceType.ps1 b/source/Private/ConvertTo-ManagedServiceType.ps1 index dd98f5102b..32bcfac37c 100644 --- a/source/Private/ConvertTo-ManagedServiceType.ps1 +++ b/source/Private/ConvertTo-ManagedServiceType.ps1 @@ -14,10 +14,21 @@ ConvertTo-ManagedServiceType -ServiceType 'DatabaseEngine' Returns the manged service type name for the normalized service type 'DatabaseEngine'. + + .INPUTS + `System.String` + + Accepts a normalized service type name via the pipeline. + + .OUTPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.ManagedServiceType` + + Returns the managed service type. #> function ConvertTo-ManagedServiceType { [CmdletBinding()] + [OutputType([Microsoft.SqlServer.Management.Smo.Wmi.ManagedServiceType])] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] diff --git a/source/Private/ConvertTo-RedactedText.ps1 b/source/Private/ConvertTo-RedactedText.ps1 index 71d9701a01..75af9016d9 100644 --- a/source/Private/ConvertTo-RedactedText.ps1 +++ b/source/Private/ConvertTo-RedactedText.ps1 @@ -27,10 +27,21 @@ ConvertTo-RedactedText -Text 'My secret phrase: secret123' -RedactPhrase 'secret123' -RedactWith '----' Returns the text with the phrases redacted to '----'. + + .INPUTS + `System.String` + + Accepts text to be redacted via the pipeline. + + .OUTPUTS + `System.String` + + Returns the redacted text. #> function ConvertTo-RedactedText { [CmdletBinding()] + [OutputType([System.String])] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] diff --git a/source/Private/Get-AgentAlertObject.ps1 b/source/Private/Get-AgentAlertObject.ps1 index 339d7b5b11..fc38def44a 100644 --- a/source/Private/Get-AgentAlertObject.ps1 +++ b/source/Private/Get-AgentAlertObject.ps1 @@ -11,15 +11,13 @@ .PARAMETER Name Specifies the name of the SQL Agent Alert. - .OUTPUTS - Microsoft.SqlServer.Management.Smo.Agent.Alert - - Returns the SQL Agent Alert object when an alert with the specified name is found. + .INPUTS + None. .OUTPUTS - None. + `Microsoft.SqlServer.Management.Smo.Agent.Alert` - When no alert with the specified name is found. + Returns the SQL Agent Alert object when an alert with the specified name is found, or $null if not found. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine diff --git a/source/Private/Get-AgentOperatorObject.ps1 b/source/Private/Get-AgentOperatorObject.ps1 index 2dad3c289a..a26c9468a1 100644 --- a/source/Private/Get-AgentOperatorObject.ps1 +++ b/source/Private/Get-AgentOperatorObject.ps1 @@ -21,9 +21,9 @@ None. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Agent.Operator + `Microsoft.SqlServer.Management.Smo.Agent.Operator` - Returns the operator object if found. + Returns the operator object if found, or $null if not found. .EXAMPLE $operatorObject = Get-AgentOperatorObject -ServerObject $serverObject -Name 'TestOperator' diff --git a/source/Private/Get-CommandParameter.ps1 b/source/Private/Get-CommandParameter.ps1 index dd210dca45..2dc22961ef 100644 --- a/source/Private/Get-CommandParameter.ps1 +++ b/source/Private/Get-CommandParameter.ps1 @@ -18,7 +18,7 @@ None. .OUTPUTS - System.String[] + `System.String[]` Returns an array of parameter names that are not excluded. diff --git a/source/Private/Get-FileVersionInformation.ps1 b/source/Private/Get-FileVersionInformation.ps1 index b412ec533d..a5203e30d9 100644 --- a/source/Private/Get-FileVersionInformation.ps1 +++ b/source/Private/Get-FileVersionInformation.ps1 @@ -18,8 +18,15 @@ Returns the version information for the file setup.exe. + .INPUTS + `System.IO.FileInfo` + + Accepts a file path via the pipeline. + .OUTPUTS - [System.String] + `System.Diagnostics.FileVersionInfo` + + Returns the file version information. #> function Get-FileVersionInformation { diff --git a/source/Private/Get-SMOModuleCalculatedVersion.ps1 b/source/Private/Get-SMOModuleCalculatedVersion.ps1 index 10dde308f3..f4a051eace 100644 --- a/source/Private/Get-SMOModuleCalculatedVersion.ps1 +++ b/source/Private/Get-SMOModuleCalculatedVersion.ps1 @@ -22,8 +22,15 @@ Returns the calculated version as a string. + .INPUTS + `System.Management.Automation.PSModuleInfo` + + Accepts a PowerShell module info object via the pipeline. + .OUTPUTS - [System.String] + `System.String` + + Returns the calculated version as a string. #> function Get-SMOModuleCalculatedVersion { diff --git a/source/Private/Invoke-ReportServerSetupAction.ps1 b/source/Private/Invoke-ReportServerSetupAction.ps1 index 1058c620f4..3d9e161ddd 100644 --- a/source/Private/Invoke-ReportServerSetupAction.ps1 +++ b/source/Private/Invoke-ReportServerSetupAction.ps1 @@ -70,9 +70,13 @@ https://learn.microsoft.com/en-us/power-bi/report-server/install-report-server https://learn.microsoft.com/en-us/sql/reporting-services/install-windows/install-reporting-services + .INPUTS + None. + .OUTPUTS - When PassThru is specified the function will return the setup process exit - code as System.Int32. Otherwise, the function does not generate any output. + `System.Int32` + + When PassThru is specified, returns the setup process exit code. Otherwise, no output is generated. .EXAMPLE Invoke-ReportServerSetupAction -Install -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' diff --git a/source/Private/Invoke-SetupAction.ps1 b/source/Private/Invoke-SetupAction.ps1 index c0084d6a70..9af17a1df2 100644 --- a/source/Private/Invoke-SetupAction.ps1 +++ b/source/Private/Invoke-SetupAction.ps1 @@ -372,6 +372,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Add-SqlDscFileGroup.ps1 b/source/Public/Add-SqlDscFileGroup.ps1 index e81f0e0c69..de11fe5489 100644 --- a/source/Public/Add-SqlDscFileGroup.ps1 +++ b/source/Public/Add-SqlDscFileGroup.ps1 @@ -21,17 +21,17 @@ Specifies that the FileGroup should be added without confirmation. .INPUTS - Microsoft.SqlServer.Management.Smo.FileGroup + `Microsoft.SqlServer.Management.Smo.FileGroup` FileGroup objects that will be added to the Database. .OUTPUTS - None + None. This cmdlet does not generate output by default. .OUTPUTS - Microsoft.SqlServer.Management.Smo.FileGroup[] + `Microsoft.SqlServer.Management.Smo.FileGroup[]` When the PassThru parameter is specified, returns the FileGroup objects that were added. diff --git a/source/Public/Add-SqlDscNode.ps1 b/source/Public/Add-SqlDscNode.ps1 index a3074fd10d..8b00e62d79 100644 --- a/source/Public/Add-SqlDscNode.ps1 +++ b/source/Public/Add-SqlDscNode.ps1 @@ -108,6 +108,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Add-SqlDscTraceFlag.ps1 b/source/Public/Add-SqlDscTraceFlag.ps1 index 083fc1f864..f1088132a6 100644 --- a/source/Public/Add-SqlDscTraceFlag.ps1 +++ b/source/Public/Add-SqlDscTraceFlag.ps1 @@ -47,6 +47,11 @@ Adds the trace flags 4199 and 3226 on the Database Engine instance 'SQL2022' on the server where the command in run. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.Service` + + Accepts a SQL Server managed service object via the pipeline. + .OUTPUTS None. #> diff --git a/source/Public/Assert-SqlDscAgentOperator.ps1 b/source/Public/Assert-SqlDscAgentOperator.ps1 index 735f32b8e2..3333e58332 100644 --- a/source/Public/Assert-SqlDscAgentOperator.ps1 +++ b/source/Public/Assert-SqlDscAgentOperator.ps1 @@ -14,13 +14,13 @@ Specifies the name of the operator to check for. .INPUTS - [Microsoft.SqlServer.Management.Smo.Server] + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts a SQL Server server object via the pipeline. .OUTPUTS None. - This command does not return anything if the operator exists. - .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' $serverObject | Assert-SqlDscAgentOperator -Name 'TestOperator' diff --git a/source/Public/Assert-SqlDscLogin.ps1 b/source/Public/Assert-SqlDscLogin.ps1 index 5eb53794fd..7e09cbef18 100644 --- a/source/Public/Assert-SqlDscLogin.ps1 +++ b/source/Public/Assert-SqlDscLogin.ps1 @@ -25,6 +25,14 @@ Asserts that the principal 'MyLogin' exists as a login. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts a SQL Server server object via the pipeline. + + .OUTPUTS + None. + .NOTES This command throws a terminating error if the specified SQL Server principal does not exist as a SQL server login. @@ -33,6 +41,7 @@ function Assert-SqlDscLogin { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseSyntacticallyCorrectExamples', '', Justification = 'Because the rule does not yet support parsing the code when a parameter type is not available. The ScriptAnalyzer rule UseSyntacticallyCorrectExamples will always error in the editor due to https://github.com/indented-automation/Indented.ScriptAnalyzerRules/issues/8.')] [CmdletBinding()] + [OutputType()] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] diff --git a/source/Public/Complete-SqlDscFailoverCluster.ps1 b/source/Public/Complete-SqlDscFailoverCluster.ps1 index 77128130ed..07eaac14d1 100644 --- a/source/Public/Complete-SqlDscFailoverCluster.ps1 +++ b/source/Public/Complete-SqlDscFailoverCluster.ps1 @@ -129,6 +129,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Complete-SqlDscImage.ps1 b/source/Public/Complete-SqlDscImage.ps1 index 5873d3eaab..102715d061 100644 --- a/source/Public/Complete-SqlDscImage.ps1 +++ b/source/Public/Complete-SqlDscImage.ps1 @@ -157,6 +157,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Connect-SqlDscDatabaseEngine.ps1 b/source/Public/Connect-SqlDscDatabaseEngine.ps1 index 700847ca85..d01734230a 100644 --- a/source/Public/Connect-SqlDscDatabaseEngine.ps1 +++ b/source/Public/Connect-SqlDscDatabaseEngine.ps1 @@ -59,11 +59,18 @@ Connects to the default instance on the local server using the SQL login 'sa'. + .INPUTS + None. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Server]` + `Microsoft.SqlServer.Management.Smo.Server` + + Returns the SQL Server server object. #> function Connect-SqlDscDatabaseEngine { + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseSyntacticallyCorrectExamples', '', Justification = 'Because the rule does not yet support parsing the code when the output type is not available. The ScriptAnalyzer rule UseSyntacticallyCorrectExamples will always error in the editor due to https://github.com/indented-automation/Indented.ScriptAnalyzerRules/issues/8.')] + [OutputType([Microsoft.SqlServer.Management.Smo.Server])] [CmdletBinding(DefaultParameterSetName = 'SqlServer')] param ( diff --git a/source/Public/ConvertFrom-SqlDscDatabasePermission.ps1 b/source/Public/ConvertFrom-SqlDscDatabasePermission.ps1 index eabb27bb13..936672ffa2 100644 --- a/source/Public/ConvertFrom-SqlDscDatabasePermission.ps1 +++ b/source/Public/ConvertFrom-SqlDscDatabasePermission.ps1 @@ -19,8 +19,15 @@ Returns an object of `[Microsoft.SqlServer.Management.Smo.DatabasePermissionSet]` with all the permissions set to $true that was part of the `[DatabasePermission]`. + .INPUTS + `DatabasePermission` + + Accepts a DatabasePermission object via the pipeline. + .OUTPUTS - [Microsoft.SqlServer.Management.Smo.DatabasePermissionSet] + `Microsoft.SqlServer.Management.Smo.DatabasePermissionSet` + + Returns a database permission set object. #> function ConvertFrom-SqlDscDatabasePermission { diff --git a/source/Public/ConvertFrom-SqlDscServerPermission.ps1 b/source/Public/ConvertFrom-SqlDscServerPermission.ps1 index a24b7c4f63..c600a95882 100644 --- a/source/Public/ConvertFrom-SqlDscServerPermission.ps1 +++ b/source/Public/ConvertFrom-SqlDscServerPermission.ps1 @@ -16,11 +16,18 @@ Permission = 'Connect' } | ConvertFrom-SqlDscServerPermission - Returns an object of `[Microsoft.SqlServer.Management.Smo.ServerPermissionSet]` + Returns an object of type `[Microsoft.SqlServer.Management.Smo.ServerPermissionSet]` with all the permissions set to $true that was part of the `[ServerPermission]`. + .INPUTS + `ServerPermission` + + Accepts a ServerPermission object via the pipeline. + .OUTPUTS - [Microsoft.SqlServer.Management.Smo.ServerPermissionSet] + `Microsoft.SqlServer.Management.Smo.ServerPermissionSet` + + Returns a server permission set object. #> function ConvertFrom-SqlDscServerPermission { diff --git a/source/Public/ConvertTo-SqlDscDataFile.ps1 b/source/Public/ConvertTo-SqlDscDataFile.ps1 index b2a81e473c..65e04dd72e 100644 --- a/source/Public/ConvertTo-SqlDscDataFile.ps1 +++ b/source/Public/ConvertTo-SqlDscDataFile.ps1 @@ -14,12 +14,12 @@ The DatabaseFileSpec object containing the data file configuration. .INPUTS - None + None. This command does not accept pipeline input. .OUTPUTS - Microsoft.SqlServer.Management.Smo.DataFile + `Microsoft.SqlServer.Management.Smo.DataFile` Returns a SMO DataFile object bound to the provided FileGroup. diff --git a/source/Public/ConvertTo-SqlDscDatabasePermission.ps1 b/source/Public/ConvertTo-SqlDscDatabasePermission.ps1 index 7ebd5a7386..7c646f119e 100644 --- a/source/Public/ConvertTo-SqlDscDatabasePermission.ps1 +++ b/source/Public/ConvertTo-SqlDscDatabasePermission.ps1 @@ -19,8 +19,15 @@ Get all permissions for the principal 'MyPrincipal' and converts the permissions into an array of `[DatabasePermission[]]`. + .INPUTS + `Microsoft.SqlServer.Management.Smo.DatabasePermissionInfo[]` + + Accepts database permission info objects via the pipeline. + .OUTPUTS - [DatabasePermission[]] + `DatabasePermission[]` + + Returns an array of DatabasePermission objects. #> function ConvertTo-SqlDscDatabasePermission { diff --git a/source/Public/ConvertTo-SqlDscEditionName.ps1 b/source/Public/ConvertTo-SqlDscEditionName.ps1 index 3a27a8212e..11be982267 100644 --- a/source/Public/ConvertTo-SqlDscEditionName.ps1 +++ b/source/Public/ConvertTo-SqlDscEditionName.ps1 @@ -21,8 +21,14 @@ Returns information about the edition ID 2017617798. - .NOTES - Author: SqlServerDsc + .INPUTS + None. + + .OUTPUTS + `System.Management.Automation.PSCustomObject` + + Returns a custom object with EditionId, Edition, and EditionName properties. + #> function ConvertTo-SqlDscEditionName { diff --git a/source/Public/ConvertTo-SqlDscFileGroup.ps1 b/source/Public/ConvertTo-SqlDscFileGroup.ps1 index 0e1de42bba..c7afc1e932 100644 --- a/source/Public/ConvertTo-SqlDscFileGroup.ps1 +++ b/source/Public/ConvertTo-SqlDscFileGroup.ps1 @@ -14,8 +14,13 @@ .PARAMETER FileGroupSpec The DatabaseFileGroupSpec object containing the file group configuration. + .INPUTS + None. + .OUTPUTS - Microsoft.SqlServer.Management.Smo.FileGroup + `Microsoft.SqlServer.Management.Smo.FileGroup` + + Returns a FileGroup object configured with the specified properties and data files. .EXAMPLE $fileSpec = New-SqlDscDataFile -Name 'TestDB_Data' -FileName 'C:\SQLData\TestDB.mdf' -AsSpec diff --git a/source/Public/ConvertTo-SqlDscServerPermission.ps1 b/source/Public/ConvertTo-SqlDscServerPermission.ps1 index f45dd3c9ec..bfcfae555e 100644 --- a/source/Public/ConvertTo-SqlDscServerPermission.ps1 +++ b/source/Public/ConvertTo-SqlDscServerPermission.ps1 @@ -19,8 +19,15 @@ Get all permissions for the principal 'MyPrincipal' and converts the permissions into an array of `[ServerPermission[]]`. + .INPUTS + `Microsoft.SqlServer.Management.Smo.ServerPermissionInfo[]` + + Accepts server permission info objects via the pipeline. + .OUTPUTS - [ServerPermission[]] + `ServerPermission[]` + + Returns an array of ServerPermission objects. #> function ConvertTo-SqlDscServerPermission { diff --git a/source/Public/Deny-SqlDscServerPermission.ps1 b/source/Public/Deny-SqlDscServerPermission.ps1 index d7dd127beb..9dda78020c 100644 --- a/source/Public/Deny-SqlDscServerPermission.ps1 +++ b/source/Public/Deny-SqlDscServerPermission.ps1 @@ -22,6 +22,16 @@ .PARAMETER Force Specifies that the permissions should be denied without any confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` + + Accepts a SQL Server login object via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.ServerRole` + + Accepts a SQL Server server role object via the pipeline. + .OUTPUTS None. diff --git a/source/Public/Disable-SqlDscAgentOperator.ps1 b/source/Public/Disable-SqlDscAgentOperator.ps1 index b1f5e6d301..96a8204738 100644 --- a/source/Public/Disable-SqlDscAgentOperator.ps1 +++ b/source/Public/Disable-SqlDscAgentOperator.ps1 @@ -50,12 +50,12 @@ Refreshes the server operators collection before disabling **MyOperator**. .INPUTS - [Microsoft.SqlServer.Management.Smo.Server] + `Microsoft.SqlServer.Management.Smo.Server` Server object accepted from the pipeline (ServerObject parameter set). .INPUTS - [Microsoft.SqlServer.Management.Smo.Agent.Operator] + `Microsoft.SqlServer.Management.Smo.Agent.Operator` Operator object accepted from the pipeline (OperatorObject parameter set). diff --git a/source/Public/Disable-SqlDscAudit.ps1 b/source/Public/Disable-SqlDscAudit.ps1 index 3504507688..9a9381accd 100644 --- a/source/Public/Disable-SqlDscAudit.ps1 +++ b/source/Public/Disable-SqlDscAudit.ps1 @@ -35,7 +35,12 @@ $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' $sqlServerObject | Disable-SqlDscAudit -Name 'MyFileAudit' - Disables the audit named **MyFileAudit**. + Disables the audit named 'MyFileAudit'. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts a SQL Server server object via the pipeline. .OUTPUTS None. diff --git a/source/Public/Disable-SqlDscDatabaseSnapshotIsolation.ps1 b/source/Public/Disable-SqlDscDatabaseSnapshotIsolation.ps1 index dcbe5d281e..1767addb22 100644 --- a/source/Public/Disable-SqlDscDatabaseSnapshotIsolation.ps1 +++ b/source/Public/Disable-SqlDscDatabaseSnapshotIsolation.ps1 @@ -55,7 +55,7 @@ Disables snapshot isolation and returns the updated database object. .INPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` The database object to modify (from Get-SqlDscDatabase). @@ -65,7 +65,7 @@ By default, no output is returned. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` When PassThru is specified, the updated database object is returned. #> diff --git a/source/Public/Disable-SqlDscLogin.ps1 b/source/Public/Disable-SqlDscLogin.ps1 index ab40e2cbb9..a810f217f3 100644 --- a/source/Public/Disable-SqlDscLogin.ps1 +++ b/source/Public/Disable-SqlDscLogin.ps1 @@ -49,11 +49,12 @@ Refreshes the server logins collection before disabling **MyLogin**. .INPUTS - [Microsoft.SqlServer.Management.Smo.Server] + `Microsoft.SqlServer.Management.Smo.Server` Server object accepted from the pipeline (ServerObject parameter set). - [Microsoft.SqlServer.Management.Smo.Login] + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` Login object accepted from the pipeline (LoginObject parameter set). diff --git a/source/Public/Disconnect-SqlDscDatabaseEngine.ps1 b/source/Public/Disconnect-SqlDscDatabaseEngine.ps1 index 19c88adb4b..879b83c69e 100644 --- a/source/Public/Disconnect-SqlDscDatabaseEngine.ps1 +++ b/source/Public/Disconnect-SqlDscDatabaseEngine.ps1 @@ -22,13 +22,18 @@ Connects and then disconnects from the default instance on the local server. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts a SQL Server server object via the pipeline. + .OUTPUTS None. #> function Disconnect-SqlDscDatabaseEngine { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('UseSyntacticallyCorrectExamples', '', Justification = 'Because the rule does not yet support parsing the code when a parameter type is not available. The ScriptAnalyzer rule UseSyntacticallyCorrectExamples will always error in the editor due to https://github.com/indented-automation/Indented.ScriptAnalyzerRules/issues/8.')] - [OutputType([System.Data.DataSet])] + [OutputType()] [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param ( diff --git a/source/Public/Enable-SqlDscAgentOperator.ps1 b/source/Public/Enable-SqlDscAgentOperator.ps1 index 2a0f266576..756ad84d38 100644 --- a/source/Public/Enable-SqlDscAgentOperator.ps1 +++ b/source/Public/Enable-SqlDscAgentOperator.ps1 @@ -38,12 +38,12 @@ Enables the operator named **MyOperator**. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` When using the ServerObject parameter set, a Server object can be piped in. .INPUTS - Microsoft.SqlServer.Management.Smo.Agent.Operator + `Microsoft.SqlServer.Management.Smo.Agent.Operator` When using the OperatorObject parameter set, an Operator object can be piped in. diff --git a/source/Public/Enable-SqlDscAudit.ps1 b/source/Public/Enable-SqlDscAudit.ps1 index b78a4d8379..388ca41e59 100644 --- a/source/Public/Enable-SqlDscAudit.ps1 +++ b/source/Public/Enable-SqlDscAudit.ps1 @@ -35,7 +35,17 @@ $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' $sqlServerObject | Enable-SqlDscAudit -Name 'MyFileAudit' - Enables the audit named **MyFileAudit**. + Enables the audit named 'MyFileAudit'. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts a SQL Server server object via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Audit` + + Accepts an audit object via the pipeline. .OUTPUTS None. diff --git a/source/Public/Enable-SqlDscDatabaseSnapshotIsolation.ps1 b/source/Public/Enable-SqlDscDatabaseSnapshotIsolation.ps1 index ff86d59a21..8588db23a0 100644 --- a/source/Public/Enable-SqlDscDatabaseSnapshotIsolation.ps1 +++ b/source/Public/Enable-SqlDscDatabaseSnapshotIsolation.ps1 @@ -55,7 +55,7 @@ Enables snapshot isolation and returns the updated database object. .INPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` The database object to modify (from Get-SqlDscDatabase). @@ -65,7 +65,7 @@ By default, no output is returned. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` When PassThru is specified, the updated database object is returned. #> diff --git a/source/Public/Enable-SqlDscLogin.ps1 b/source/Public/Enable-SqlDscLogin.ps1 index 967e63231c..8676e35751 100644 --- a/source/Public/Enable-SqlDscLogin.ps1 +++ b/source/Public/Enable-SqlDscLogin.ps1 @@ -38,11 +38,14 @@ Enables the login named **MyLogin**. .INPUTS - Microsoft.SqlServer.Management.Smo.Server - When using the ServerObject parameter set, a Server object can be piped in. + `Microsoft.SqlServer.Management.Smo.Server` - Microsoft.SqlServer.Management.Smo.Login - When using the LoginObject parameter set, a Login object can be piped in. + Server object accepted from the pipeline (ServerObject parameter set). + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` + + Login object accepted from the pipeline (LoginObject parameter set). .OUTPUTS None. diff --git a/source/Public/Get-SqlDscAgentAlert.ps1 b/source/Public/Get-SqlDscAgentAlert.ps1 index 7814860cea..ede70733a4 100644 --- a/source/Public/Get-SqlDscAgentAlert.ps1 +++ b/source/Public/Get-SqlDscAgentAlert.ps1 @@ -13,23 +13,25 @@ all alerts are returned. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Agent.Alert + `Microsoft.SqlServer.Management.Smo.Agent.Alert` When using the ByName parameter set, returns a single SQL Agent Alert object. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Agent.Alert[] + `Microsoft.SqlServer.Management.Smo.Agent.Alert[]` When using the All parameter set, returns an array of SQL Agent Alert objects. .OUTPUTS - None + None. + Returns nothing when no alerts are found for the specified criteria. + .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine Get-SqlDscAgentAlert -ServerObject $serverObject diff --git a/source/Public/Get-SqlDscAgentOperator.ps1 b/source/Public/Get-SqlDscAgentOperator.ps1 index 2457328c9a..08f3746eb8 100644 --- a/source/Public/Get-SqlDscAgentOperator.ps1 +++ b/source/Public/Get-SqlDscAgentOperator.ps1 @@ -13,23 +13,20 @@ all operators are returned. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Agent.Operator + `Microsoft.SqlServer.Management.Smo.Agent.Operator` - When using the ByName parameter set, returns a single SQL Agent Operator object. + Returns a single SQL Agent Operator object when using the ByName parameter set. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Agent.Operator[] + `Microsoft.SqlServer.Management.Smo.Agent.Operator[]` - When using the All parameter set, returns an array of SQL Agent Operator objects. + Returns an array of SQL Agent Operator objects when using the All parameter set. - .OUTPUTS - None - Returns nothing when no operators are found for the specified criteria. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine Get-SqlDscAgentOperator -ServerObject $serverObject diff --git a/source/Public/Get-SqlDscAudit.ps1 b/source/Public/Get-SqlDscAudit.ps1 index 018126d727..a89fa19597 100644 --- a/source/Public/Get-SqlDscAudit.ps1 +++ b/source/Public/Get-SqlDscAudit.ps1 @@ -24,9 +24,15 @@ Get the audit named **MyFileAudit**. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts a SQL Server server object via the pipeline. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Audit[]]` - Array of SMO Audit objects from the target SQL Server instance. + `Microsoft.SqlServer.Management.Smo.Audit[]` + + Returns an array of SMO Audit objects from the target SQL Server instance. #> function Get-SqlDscAudit { diff --git a/source/Public/Get-SqlDscCompatibilityLevel.ps1 b/source/Public/Get-SqlDscCompatibilityLevel.ps1 index cbcc56af3c..cab81da63a 100644 --- a/source/Public/Get-SqlDscCompatibilityLevel.ps1 +++ b/source/Public/Get-SqlDscCompatibilityLevel.ps1 @@ -34,12 +34,12 @@ Returns all supported compatibility levels for SQL Server 2022 (version 16). .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` The server object to get supported compatibility levels for. .OUTPUTS - System.String[] + `System.String[]` Returns an array of supported compatibility level names (e.g., 'Version160', 'Version150'). #> diff --git a/source/Public/Get-SqlDscConfigurationOption.ps1 b/source/Public/Get-SqlDscConfigurationOption.ps1 index da77f13347..e40994b569 100644 --- a/source/Public/Get-SqlDscConfigurationOption.ps1 +++ b/source/Public/Get-SqlDscConfigurationOption.ps1 @@ -49,11 +49,11 @@ Get all configuration options as raw SMO ConfigProperty objects. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Management Objects (SMO) Server object representing a SQL Server instance. .OUTPUTS - PSCustomObject[] + `PSCustomObject[]` Returns user-friendly metadata objects with configuration option details (default behavior). Microsoft.SqlServer.Management.Smo.ConfigProperty[] diff --git a/source/Public/Get-SqlDscDatabase.ps1 b/source/Public/Get-SqlDscDatabase.ps1 index 1b7476b513..b3b353dd7f 100644 --- a/source/Public/Get-SqlDscDatabase.ps1 +++ b/source/Public/Get-SqlDscDatabase.ps1 @@ -32,8 +32,15 @@ Get the database named **MyDatabase**. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Database[]]` + `Microsoft.SqlServer.Management.Smo.Database[]` + + Returns one or more database objects from the SQL Server instance. #> function Get-SqlDscDatabase { diff --git a/source/Public/Get-SqlDscDatabasePermission.ps1 b/source/Public/Get-SqlDscDatabasePermission.ps1 index f7538ca18b..52d9fef5fc 100644 --- a/source/Public/Get-SqlDscDatabasePermission.ps1 +++ b/source/Public/Get-SqlDscDatabasePermission.ps1 @@ -23,8 +23,15 @@ amount of principals it might be better to make sure the **ServerObject** is recent enough. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - [Microsoft.SqlServer.Management.Smo.DatabasePermissionInfo[]] + `Microsoft.SqlServer.Management.Smo.DatabasePermissionInfo[]` + + Returns an array of database permission information objects. .EXAMPLE $serverInstance = Connect-SqlDscDatabaseEngine diff --git a/source/Public/Get-SqlDscInstalledInstance.ps1 b/source/Public/Get-SqlDscInstalledInstance.ps1 index ab8b323eb9..d18a756efb 100644 --- a/source/Public/Get-SqlDscInstalledInstance.ps1 +++ b/source/Public/Get-SqlDscInstalledInstance.ps1 @@ -12,8 +12,12 @@ Specifies the service type to filter instances by. Valid values are 'DatabaseEngine', 'AnalysisServices', and 'ReportingServices'. - .OUTPUTS - `[System.Object[]]` + + .INPUTS + None. + +.OUTPUTS + `System.Object[]` .EXAMPLE Get-SqlDscInstalledInstance diff --git a/source/Public/Get-SqlDscLogin.ps1 b/source/Public/Get-SqlDscLogin.ps1 index 3df0c57e35..f55ab006fe 100644 --- a/source/Public/Get-SqlDscLogin.ps1 +++ b/source/Public/Get-SqlDscLogin.ps1 @@ -25,14 +25,20 @@ Get the login named **MyLogin**. - .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Login]` + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + +.OUTPUTS + `Microsoft.SqlServer.Management.Smo.Login` Returns a single Login object when the Name parameter is specified and a match is found. .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Login[]]` + `Microsoft.SqlServer.Management.Smo.Login[]` Returns an array of Login objects when the Name parameter is not specified (returns all logins) or when multiple matches are found. diff --git a/source/Public/Get-SqlDscManagedComputer.ps1 b/source/Public/Get-SqlDscManagedComputer.ps1 index 63d1796ddc..055fa229ff 100644 --- a/source/Public/Get-SqlDscManagedComputer.ps1 +++ b/source/Public/Get-SqlDscManagedComputer.ps1 @@ -19,8 +19,13 @@ Returns the managed computer object for the server 'MyServer'. + .INPUTS + None. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer]` + `Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer` + + A managed computer object representing the SQL Server instance. #> function Get-SqlDscManagedComputer { diff --git a/source/Public/Get-SqlDscManagedComputerInstance.ps1 b/source/Public/Get-SqlDscManagedComputerInstance.ps1 index 05b75739e0..36361f4ca7 100644 --- a/source/Public/Get-SqlDscManagedComputerInstance.ps1 +++ b/source/Public/Get-SqlDscManagedComputerInstance.ps1 @@ -40,12 +40,12 @@ Uses pipeline input to retrieve a specific instance from a managed computer object. .INPUTS - Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer + `Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer` A managed computer object can be piped to this command. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Wmi.ServerInstance + `Microsoft.SqlServer.Management.Smo.Wmi.ServerInstance` Returns server instance objects from SMO (SQL Server Management Objects). diff --git a/source/Public/Get-SqlDscManagedComputerService.ps1 b/source/Public/Get-SqlDscManagedComputerService.ps1 index 94c975ed03..81d8035830 100644 --- a/source/Public/Get-SqlDscManagedComputerService.ps1 +++ b/source/Public/Get-SqlDscManagedComputerService.ps1 @@ -45,8 +45,16 @@ Returns all the managed computer service objects for instance SQL2022. - .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Wmi.Service[]]` + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer` + + Accepts input via the pipeline. + +.OUTPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.Service[]` + + An array of managed computer service objects. #> function Get-SqlDscManagedComputerService { diff --git a/source/Public/Get-SqlDscPreferredModule.ps1 b/source/Public/Get-SqlDscPreferredModule.ps1 index 685a089037..b463d1756b 100644 --- a/source/Public/Get-SqlDscPreferredModule.ps1 +++ b/source/Public/Get-SqlDscPreferredModule.ps1 @@ -42,7 +42,13 @@ return SQLPS PSModuleInfo object if is is installed. If neither is installed `$null` is returned. - .NOTES + .INPUTS + None. + + .OUTPUTS + `PSModuleInfo` + + Returns a PSModuleInfo object for the preferred module, or $null if not found. #> function Get-SqlDscPreferredModule diff --git a/source/Public/Get-SqlDscRSSetupConfiguration.ps1 b/source/Public/Get-SqlDscRSSetupConfiguration.ps1 index 73847bf14b..8cdee6500a 100644 --- a/source/Public/Get-SqlDscRSSetupConfiguration.ps1 +++ b/source/Public/Get-SqlDscRSSetupConfiguration.ps1 @@ -37,23 +37,15 @@ Returns configuration information about the Power BI Report Server instance 'PBIRS'. + .INPUTS + None. + .OUTPUTS - Returns a PSCustomObject with the following properties: - - InstanceName: The name of the Reporting Services instance. - - InstallFolder: The installation folder path. - - ServiceName: The name of the service. - - ErrorDumpDirectory: The path to the error dump directory. - - CustomerFeedback: Whether customer feedback is enabled. - - EnableErrorReporting: Whether error reporting is enabled. - - ProductVersion: The product version from registry. - - CurrentVersion: The current version from registry. - - VirtualRootServer: The virtual root server value. - - ConfigFilePath: The path to the report server configuration file. - - EditionID: The edition ID of the Reporting Services instance. - - EditionName: The edition name of the Reporting Services instance. - - IsSharePointIntegrated: Whether the instance is SharePoint integrated. - MSReportServer_Instance. - - InstanceId: The instance ID of the Reporting Services instance. + `PSCustomObject[]` + + Returns an array of custom objects containing Reporting Services configuration + information including instance name, installation folder, service details, version + information, and additional properties. #> function Get-SqlDscRSSetupConfiguration { diff --git a/source/Public/Get-SqlDscRole.ps1 b/source/Public/Get-SqlDscRole.ps1 index 5fd900d33b..9a80c82b65 100644 --- a/source/Public/Get-SqlDscRole.ps1 +++ b/source/Public/Get-SqlDscRole.ps1 @@ -32,8 +32,15 @@ Get the server role named **MyCustomRole**. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.ServerRole[]]` + `Microsoft.SqlServer.Management.Smo.ServerRole[]` + + Returns the server role objects from the instance. #> function Get-SqlDscRole { diff --git a/source/Public/Get-SqlDscServerPermission.ps1 b/source/Public/Get-SqlDscServerPermission.ps1 index 5914cdae7c..b1b86f5d06 100644 --- a/source/Public/Get-SqlDscServerPermission.ps1 +++ b/source/Public/Get-SqlDscServerPermission.ps1 @@ -34,8 +34,26 @@ Specifies the ServerRole object for which the permissions are returned. This parameter accepts pipeline input. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Server object accepted from the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` + + Login object accepted from the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.ServerRole` + + ServerRole object accepted from the pipeline. + .OUTPUTS - [Microsoft.SqlServer.Management.Smo.ServerPermissionInfo[]] + `Microsoft.SqlServer.Management.Smo.ServerPermissionInfo[]` + + Returns server permissions for the specified principal. .EXAMPLE $serverInstance = Connect-SqlDscDatabaseEngine diff --git a/source/Public/Get-SqlDscServerProtocol.ps1 b/source/Public/Get-SqlDscServerProtocol.ps1 index faa2825d50..9ad6bae339 100644 --- a/source/Public/Get-SqlDscServerProtocol.ps1 +++ b/source/Public/Get-SqlDscServerProtocol.ps1 @@ -61,16 +61,17 @@ protocol information. .INPUTS - Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer + `Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer` A managed computer object can be piped to this command. - Microsoft.SqlServer.Management.Smo.Wmi.ServerInstance + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.ServerInstance` A server instance object can be piped to this command. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Wmi.ServerProtocol + `Microsoft.SqlServer.Management.Smo.Wmi.ServerProtocol` Returns server protocol objects from SMO (SQL Server Management Objects). #> diff --git a/source/Public/Get-SqlDscServerProtocolName.ps1 b/source/Public/Get-SqlDscServerProtocolName.ps1 index a1a5ed9d8d..9c33db0831 100644 --- a/source/Public/Get-SqlDscServerProtocolName.ps1 +++ b/source/Public/Get-SqlDscServerProtocolName.ps1 @@ -43,10 +43,10 @@ Returns all available protocol name mappings. .INPUTS - None + None. .OUTPUTS - System.Management.Automation.PSCustomObject + `System.Management.Automation.PSCustomObject` Returns a PSCustomObject with the properties Name, DisplayName, and ShortName. diff --git a/source/Public/Get-SqlDscSetupLog.ps1 b/source/Public/Get-SqlDscSetupLog.ps1 index be8cd75c35..be0d36b410 100644 --- a/source/Public/Get-SqlDscSetupLog.ps1 +++ b/source/Public/Get-SqlDscSetupLog.ps1 @@ -34,7 +34,7 @@ None. This command does not accept pipeline input. .OUTPUTS - `[System.String[]]` + `System.String[]` Returns the content of the setup log file, or null if no log file is found. #> diff --git a/source/Public/Get-SqlDscStartupParameter.ps1 b/source/Public/Get-SqlDscStartupParameter.ps1 index 1890e63b66..dc2a2fb112 100644 --- a/source/Public/Get-SqlDscStartupParameter.ps1 +++ b/source/Public/Get-SqlDscStartupParameter.ps1 @@ -15,12 +15,12 @@ Specifies the instance name to return the startup parameters for. .INPUTS - Microsoft.SqlServer.Management.Smo.Wmi.Service + `Microsoft.SqlServer.Management.Smo.Wmi.Service` A service object representing the Database Engine service. .OUTPUTS - StartupParameters + `StartupParameters` Returns a StartupParameters object containing the startup parameters for the specified Database Engine instance. diff --git a/source/Public/Get-SqlDscTraceFlag.ps1 b/source/Public/Get-SqlDscTraceFlag.ps1 index 15c1d4fb61..ce1205b18b 100644 --- a/source/Public/Get-SqlDscTraceFlag.ps1 +++ b/source/Public/Get-SqlDscTraceFlag.ps1 @@ -40,8 +40,13 @@ Get all the trace flags from the Database Engine instance 'SQL2022' on the server where the command in run. + .INPUTS + None. + .OUTPUTS - `[System.UInt32[]]` + `System.UInt32[]` + + Returns an array of trace flags as unsigned 32-bit integer values. #> function Get-SqlDscTraceFlag { diff --git a/source/Public/Grant-SqlDscServerPermission.ps1 b/source/Public/Grant-SqlDscServerPermission.ps1 index 7589eefc7e..987140e8b6 100644 --- a/source/Public/Grant-SqlDscServerPermission.ps1 +++ b/source/Public/Grant-SqlDscServerPermission.ps1 @@ -26,6 +26,16 @@ .PARAMETER Force Specifies that the permissions should be granted without any confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` + + Accepts input via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.ServerRole` + + Accepts input via the pipeline. + .OUTPUTS None. diff --git a/source/Public/Import-SqlDscPreferredModule.ps1 b/source/Public/Import-SqlDscPreferredModule.ps1 index 20334ff398..d7e4ad93dd 100644 --- a/source/Public/Import-SqlDscPreferredModule.ps1 +++ b/source/Public/Import-SqlDscPreferredModule.ps1 @@ -39,10 +39,17 @@ Imports the specified preferred module OtherSqlModule if it exist, otherwise it will try to import the module SQLPS. + + .INPUTS + None. + + .OUTPUTS + None. #> function Import-SqlDscPreferredModule { [CmdletBinding()] + [OutputType()] param ( [Parameter()] diff --git a/source/Public/Initialize-SqlDscRebuildDatabase.ps1 b/source/Public/Initialize-SqlDscRebuildDatabase.ps1 index a10eb3e274..f8368a0b16 100644 --- a/source/Public/Initialize-SqlDscRebuildDatabase.ps1 +++ b/source/Public/Initialize-SqlDscRebuildDatabase.ps1 @@ -11,7 +11,6 @@ .PARAMETER MediaPath Specifies the path where to find the SQL Server installation media. On this path the SQL Server setup executable must be found. - .PARAMETER Timeout Specifies how long to wait for the setup process to finish. Default value is `7200` seconds (2 hours). If the setup process does not finish before @@ -57,6 +56,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Install-SqlDscBIReportServer.ps1 b/source/Public/Install-SqlDscBIReportServer.ps1 index e40aed8a40..96bfe4d948 100644 --- a/source/Public/Install-SqlDscBIReportServer.ps1 +++ b/source/Public/Install-SqlDscBIReportServer.ps1 @@ -56,9 +56,19 @@ .PARAMETER PassThru Specifies whether the command will return the setup process exit code. + + .INPUTS + None. + + .OUTPUTS + `System.Int32` + + The exit code from the setup process when PassThru is specified. + .OUTPUTS - When PassThru is specified the function will return the setup process exit - code as System.Int32. Otherwise, the function does not generate any output. + None. + + No output is generated when PassThru is not specified. .EXAMPLE Install-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' diff --git a/source/Public/Install-SqlDscReportingService.ps1 b/source/Public/Install-SqlDscReportingService.ps1 index ec24f91567..84d98b4ec8 100644 --- a/source/Public/Install-SqlDscReportingService.ps1 +++ b/source/Public/Install-SqlDscReportingService.ps1 @@ -56,9 +56,18 @@ .PARAMETER PassThru If specified the command will return the setup process exit code. + .INPUTS + None. + .OUTPUTS - When PassThru is specified the function will return the setup process exit - code as System.Int32. Otherwise, the function does not generate any output. + None. + + This command does not generate any output by default. + + .OUTPUTS + `System.Int32` + + Returns the setup process exit code when PassThru is specified. .EXAMPLE Install-SqlDscReportingService -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' @@ -90,6 +99,7 @@ function Install-SqlDscReportingService { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')] [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] + [OutputType()] [OutputType([System.Int32])] param ( diff --git a/source/Public/Install-SqlDscServer.ps1 b/source/Public/Install-SqlDscServer.ps1 index 5c79ea5a4c..e8b499986e 100644 --- a/source/Public/Install-SqlDscServer.ps1 +++ b/source/Public/Install-SqlDscServer.ps1 @@ -351,6 +351,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Invoke-SqlDscQuery.ps1 b/source/Public/Invoke-SqlDscQuery.ps1 index 5786670b8a..6081e1041c 100644 --- a/source/Public/Invoke-SqlDscQuery.ps1 +++ b/source/Public/Invoke-SqlDscQuery.ps1 @@ -48,9 +48,16 @@ .PARAMETER Force Specifies that the query should be executed without any confirmation. - .OUTPUTS - `[System.Data.DataSet]` when passing parameter **PassThru**, otherwise - outputs none. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + +.OUTPUTS + `System.Data.DataSet` + + When passing parameter **PassThru**. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine diff --git a/source/Public/New-SqlDscAgentAlert.ps1 b/source/Public/New-SqlDscAgentAlert.ps1 index 31cc46bb8c..cb32c13202 100644 --- a/source/Public/New-SqlDscAgentAlert.ps1 +++ b/source/Public/New-SqlDscAgentAlert.ps1 @@ -26,13 +26,19 @@ Forces the action without prompting for confirmation. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Agent.Alert]` if passing parameter **PassThru**, - otherwise none. + `Microsoft.SqlServer.Management.Smo.Agent.Alert` + + Returns the created alert object when using the **PassThru** parameter. + + .OUTPUTS + None. + + No output when the **PassThru** parameter is not specified. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' diff --git a/source/Public/New-SqlDscAgentOperator.ps1 b/source/Public/New-SqlDscAgentOperator.ps1 index cd13e569b7..a43568c368 100644 --- a/source/Public/New-SqlDscAgentOperator.ps1 +++ b/source/Public/New-SqlDscAgentOperator.ps1 @@ -58,13 +58,14 @@ sure the **ServerObject** is recent enough. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Agent.Operator]` if passing parameter **PassThru**, - otherwise none. + `Microsoft.SqlServer.Management.Smo.Agent.Operator` + + if passing parameter **PassThru**. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' diff --git a/source/Public/New-SqlDscAudit.ps1 b/source/Public/New-SqlDscAudit.ps1 index 3425121ff6..92f9bd7fca 100644 --- a/source/Public/New-SqlDscAudit.ps1 +++ b/source/Public/New-SqlDscAudit.ps1 @@ -66,9 +66,15 @@ .PARAMETER PassThru If specified the created audit object will be returned. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Specifies the SQL Server instance for audit creation. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Audit]` is passing parameter **PassThru**, - otherwise none. + `Microsoft.SqlServer.Management.Smo.Audit` + + When passing parameter **PassThru**. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' diff --git a/source/Public/New-SqlDscDataFile.ps1 b/source/Public/New-SqlDscDataFile.ps1 index 3a4489b307..51b79a7364 100644 --- a/source/Public/New-SqlDscDataFile.ps1 +++ b/source/Public/New-SqlDscDataFile.ps1 @@ -105,22 +105,22 @@ Creates a DatabaseFileSpec object with all properties set directly via parameters. .INPUTS - None + None. This cmdlet does not accept input from the pipeline. .OUTPUTS - None + None. This cmdlet does not generate output by default when using Standard or FromSpec parameter sets without PassThru. .OUTPUTS - Microsoft.SqlServer.Management.Smo.DataFile + `Microsoft.SqlServer.Management.Smo.DataFile` When using the Standard or FromSpec parameter sets with the PassThru parameter. .OUTPUTS - DatabaseFileSpec + `DatabaseFileSpec` When using the AsSpec parameter to create a specification object. #> diff --git a/source/Public/New-SqlDscDatabase.ps1 b/source/Public/New-SqlDscDatabase.ps1 index 3a1ea0ef5b..63f45a771b 100644 --- a/source/Public/New-SqlDscDatabase.ps1 +++ b/source/Public/New-SqlDscDatabase.ps1 @@ -334,8 +334,15 @@ legacy cardinality estimation enabled, parameter sniffing disabled, and query optimizer hotfixes enabled, without prompting for confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Database]` + `Microsoft.SqlServer.Management.Smo.Database` + + The newly created database object. #> function New-SqlDscDatabase { diff --git a/source/Public/New-SqlDscDatabaseSnapshot.ps1 b/source/Public/New-SqlDscDatabaseSnapshot.ps1 index 5dff09929f..240eb41329 100644 --- a/source/Public/New-SqlDscDatabaseSnapshot.ps1 +++ b/source/Public/New-SqlDscDatabaseSnapshot.ps1 @@ -77,17 +77,17 @@ **MyDatabase** with a specified sparse file location without prompting for confirmation. .INPUTS - `[Microsoft.SqlServer.Management.Smo.Server]` + `Microsoft.SqlServer.Management.Smo.Server` Specifies the SQL Server connection object to create the snapshot in. .INPUTS - `[Microsoft.SqlServer.Management.Smo.Database]` + `Microsoft.SqlServer.Management.Smo.Database` Specifies the source database object to create a snapshot from. .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Database]` + `Microsoft.SqlServer.Management.Smo.Database` Returns the newly created database snapshot object. diff --git a/source/Public/New-SqlDscFileGroup.ps1 b/source/Public/New-SqlDscFileGroup.ps1 index 950eab88f4..5267b28e71 100644 --- a/source/Public/New-SqlDscFileGroup.ps1 +++ b/source/Public/New-SqlDscFileGroup.ps1 @@ -73,17 +73,17 @@ Creates a DatabaseFileGroupSpec object with files and properties set directly via parameters. .INPUTS - None + None. This cmdlet does not accept input from the pipeline. .OUTPUTS - Microsoft.SqlServer.Management.Smo.FileGroup + `Microsoft.SqlServer.Management.Smo.FileGroup` When creating a FileGroup with or without an associated Database (not using -AsSpec). .OUTPUTS - DatabaseFileGroupSpec + `DatabaseFileGroupSpec` When using the -AsSpec parameter to create a specification object. #> diff --git a/source/Public/New-SqlDscLogin.ps1 b/source/Public/New-SqlDscLogin.ps1 index 0c0c8eb2da..33bc8f5873 100644 --- a/source/Public/New-SqlDscLogin.ps1 +++ b/source/Public/New-SqlDscLogin.ps1 @@ -151,11 +151,14 @@ Creates a new disabled Windows user login and returns the Login object. .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Login]` when passing parameter **PassThru**, - otherwise none. + `Microsoft.SqlServer.Management.Smo.Login` + + When passing parameter **PassThru**. .INPUTS - `[Microsoft.SqlServer.Management.Smo.Server]` Accepted from the pipeline. This cmdlet accepts a SMO Server + `Microsoft.SqlServer.Management.Smo.Server` + + Accepted from the pipeline. This cmdlet accepts a SMO Server object (for example, the output of `Connect-SqlDscDatabaseEngine`) via the pipeline. .NOTES diff --git a/source/Public/New-SqlDscRole.ps1 b/source/Public/New-SqlDscRole.ps1 index 38b752d318..15712b0b9a 100644 --- a/source/Public/New-SqlDscRole.ps1 +++ b/source/Public/New-SqlDscRole.ps1 @@ -38,8 +38,15 @@ Creates a new server role named **MyCustomRole** with the specified owner without prompting for confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.ServerRole]` + `Microsoft.SqlServer.Management.Smo.ServerRole` + + Returns the newly created server role. #> function New-SqlDscRole { diff --git a/source/Public/Remove-SqlDscAgentAlert.ps1 b/source/Public/Remove-SqlDscAgentAlert.ps1 index 96fcbde4fb..f0ffe30329 100644 --- a/source/Public/Remove-SqlDscAgentAlert.ps1 +++ b/source/Public/Remove-SqlDscAgentAlert.ps1 @@ -23,11 +23,12 @@ been modified outside of the **ServerObject**, for example through T-SQL. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. - Microsoft.SqlServer.Management.Smo.Agent.Alert + .INPUTS + `Microsoft.SqlServer.Management.Smo.Agent.Alert` SQL Agent Alert object to remove. diff --git a/source/Public/Remove-SqlDscAgentOperator.ps1 b/source/Public/Remove-SqlDscAgentOperator.ps1 index 0cc0530e9f..f532cd2e2e 100644 --- a/source/Public/Remove-SqlDscAgentOperator.ps1 +++ b/source/Public/Remove-SqlDscAgentOperator.ps1 @@ -22,12 +22,12 @@ This is only used when specifying the operator by name. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .INPUTS - Microsoft.SqlServer.Management.Smo.Agent.Operator + `Microsoft.SqlServer.Management.Smo.Agent.Operator` SQL Agent Operator object. diff --git a/source/Public/Remove-SqlDscAudit.ps1 b/source/Public/Remove-SqlDscAudit.ps1 index 8b3c204cb1..cd8ee66e74 100644 --- a/source/Public/Remove-SqlDscAudit.ps1 +++ b/source/Public/Remove-SqlDscAudit.ps1 @@ -37,6 +37,16 @@ Removes the audit named **MyFileAudit**. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts server objects via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Audit` + + Accepts audit objects via the pipeline. + .OUTPUTS None. #> diff --git a/source/Public/Remove-SqlDscDatabase.ps1 b/source/Public/Remove-SqlDscDatabase.ps1 index 4addcb1694..e5af92dd5e 100644 --- a/source/Public/Remove-SqlDscDatabase.ps1 +++ b/source/Public/Remove-SqlDscDatabase.ps1 @@ -58,6 +58,16 @@ without prompting for confirmation. This is useful when the database has active connections that prevent removal. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Server object accepted from the pipeline (ServerObject parameter set). + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Database` + + Database object accepted from the pipeline (DatabaseObject parameter set). + .OUTPUTS None. #> diff --git a/source/Public/Remove-SqlDscLogin.ps1 b/source/Public/Remove-SqlDscLogin.ps1 index b2108f3ecc..1640d178dd 100644 --- a/source/Public/Remove-SqlDscLogin.ps1 +++ b/source/Public/Remove-SqlDscLogin.ps1 @@ -37,12 +37,12 @@ Removes the login named **MyLogin**. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` Specifies a server connection object. .INPUTS - Microsoft.SqlServer.Management.Smo.Login + `Microsoft.SqlServer.Management.Smo.Login` Specifies a login object. diff --git a/source/Public/Remove-SqlDscNode.ps1 b/source/Public/Remove-SqlDscNode.ps1 index af6cc56e73..09bb760914 100644 --- a/source/Public/Remove-SqlDscNode.ps1 +++ b/source/Public/Remove-SqlDscNode.ps1 @@ -30,6 +30,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Remove-SqlDscRole.ps1 b/source/Public/Remove-SqlDscRole.ps1 index 2a08c00f28..9d1ff1655d 100644 --- a/source/Public/Remove-SqlDscRole.ps1 +++ b/source/Public/Remove-SqlDscRole.ps1 @@ -43,6 +43,16 @@ Removes the role named **MyCustomRole** without prompting for confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.ServerRole` + + Accepts input via the pipeline. + .OUTPUTS None. #> diff --git a/source/Public/Remove-SqlDscTraceFlag.ps1 b/source/Public/Remove-SqlDscTraceFlag.ps1 index ba35cfef9b..4724373049 100644 --- a/source/Public/Remove-SqlDscTraceFlag.ps1 +++ b/source/Public/Remove-SqlDscTraceFlag.ps1 @@ -47,6 +47,11 @@ Removes the trace flags 4199 and 3226 from the Database Engine instance 'SQL2022' on the server where the command in run. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.Service` + + Accepts input via the pipeline. + .OUTPUTS None. #> diff --git a/source/Public/Repair-SqlDscBIReportServer.ps1 b/source/Public/Repair-SqlDscBIReportServer.ps1 index 4241abe7a2..2829fcf880 100644 --- a/source/Public/Repair-SqlDscBIReportServer.ps1 +++ b/source/Public/Repair-SqlDscBIReportServer.ps1 @@ -55,9 +55,15 @@ .PARAMETER PassThru If specified the command will return the setup process exit code. + + .INPUTS + None. + .OUTPUTS + `System.Int32` + When PassThru is specified the function will return the setup process exit - code as System.Int32. Otherwise, the function does not generate any output. + code as System.Int32. .EXAMPLE Repair-SqlDscBIReportServer -AcceptLicensingTerms -MediaPath 'E:\PowerBIReportServer.exe' diff --git a/source/Public/Repair-SqlDscReportingService.ps1 b/source/Public/Repair-SqlDscReportingService.ps1 index 32dfc97d90..f195e7e4d4 100644 --- a/source/Public/Repair-SqlDscReportingService.ps1 +++ b/source/Public/Repair-SqlDscReportingService.ps1 @@ -57,9 +57,18 @@ .PARAMETER PassThru If specified the command will return the setup process exit code. + .INPUTS + None. + .OUTPUTS - When PassThru is specified the function will return the setup process exit - code as System.Int32. Otherwise, the function does not generate any output. + None. + + This command does not generate any output by default. + + .OUTPUTS + `System.Int32` + + Returns the setup process exit code when PassThru is specified. .EXAMPLE Repair-SqlDscReportingService -AcceptLicensingTerms -MediaPath 'E:\SQLServerReportingServices.exe' @@ -86,6 +95,7 @@ function Repair-SqlDscReportingService { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Because ShouldProcess is used in Invoke-SetupAction')] [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] + [OutputType()] [OutputType([System.Int32])] param ( diff --git a/source/Public/Repair-SqlDscServer.ps1 b/source/Public/Repair-SqlDscServer.ps1 index a4d6ebd48d..e217f560b7 100644 --- a/source/Public/Repair-SqlDscServer.ps1 +++ b/source/Public/Repair-SqlDscServer.ps1 @@ -48,6 +48,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None. diff --git a/source/Public/Resume-SqlDscDatabase.ps1 b/source/Public/Resume-SqlDscDatabase.ps1 index 6323e8f0ed..3137f8cc2a 100644 --- a/source/Public/Resume-SqlDscDatabase.ps1 +++ b/source/Public/Resume-SqlDscDatabase.ps1 @@ -58,12 +58,12 @@ Brings the database online using pipeline input without prompting for confirmation. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` The server object from Connect-SqlDscDatabaseEngine. .INPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` The database object to bring online (from Get-SqlDscDatabase). @@ -73,7 +73,7 @@ By default, no output is returned. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` When PassThru is specified, the updated database object is returned. #> diff --git a/source/Public/Revoke-SqlDscServerPermission.ps1 b/source/Public/Revoke-SqlDscServerPermission.ps1 index 6b46907179..220b5f8ef5 100644 --- a/source/Public/Revoke-SqlDscServerPermission.ps1 +++ b/source/Public/Revoke-SqlDscServerPermission.ps1 @@ -27,6 +27,16 @@ .PARAMETER Force Specifies that the permissions should be revoked without any confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` + + Accepts input via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.ServerRole` + + Accepts input via the pipeline. + .OUTPUTS None. diff --git a/source/Public/Save-SqlDscSqlServerMediaFile.ps1 b/source/Public/Save-SqlDscSqlServerMediaFile.ps1 index b5b1ceaad1..229a3a0e57 100644 --- a/source/Public/Save-SqlDscSqlServerMediaFile.ps1 +++ b/source/Public/Save-SqlDscSqlServerMediaFile.ps1 @@ -63,6 +63,14 @@ Save-SqlDscSqlServerMediaFile -Url 'https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SQLServer2016SP1-FullSlipstream-x64-ENU.iso' -DestinationPath 'C:\path\to\destination' This downloads the SQL Server 2016 media and saves it to the specified destination path. + + .INPUTS + None. + + .OUTPUTS + `System.IO.FileInfo` + + Returns a FileInfo object representing the downloaded media file. #> function Save-SqlDscSqlServerMediaFile { diff --git a/source/Public/Set-SqlDscAgentAlert.ps1 b/source/Public/Set-SqlDscAgentAlert.ps1 index 48e76bc64a..524c55fe6f 100644 --- a/source/Public/Set-SqlDscAgentAlert.ps1 +++ b/source/Public/Set-SqlDscAgentAlert.ps1 @@ -35,20 +35,23 @@ Specifies that the alert should be updated without prompting for confirmation. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. - Microsoft.SqlServer.Management.Smo.Agent.Alert + .INPUTS + `Microsoft.SqlServer.Management.Smo.Agent.Alert` SQL Agent Alert object to update. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Agent.Alert - Returned when parameter **PassThru** is specified. + `Microsoft.SqlServer.Management.Smo.Agent.Alert` + + Returned when parameter **PassThru** is specified. + + .OUTPUTS + None. - None - No output is returned unless **PassThru** is specified. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' Set-SqlDscAgentAlert -ServerObject $serverObject -Name 'MyAlert' -Severity 16 diff --git a/source/Public/Set-SqlDscAgentOperator.ps1 b/source/Public/Set-SqlDscAgentOperator.ps1 index 99b0432cb1..91a9ca52c9 100644 --- a/source/Public/Set-SqlDscAgentOperator.ps1 +++ b/source/Public/Set-SqlDscAgentOperator.ps1 @@ -51,12 +51,12 @@ Specifies that the operator should be updated without any confirmation. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .INPUTS - Microsoft.SqlServer.Management.Smo.Agent.Operator + `Microsoft.SqlServer.Management.Smo.Agent.Operator` SQL Agent Operator object. diff --git a/source/Public/Set-SqlDscAudit.ps1 b/source/Public/Set-SqlDscAudit.ps1 index 6b1649b370..6b9580a058 100644 --- a/source/Public/Set-SqlDscAudit.ps1 +++ b/source/Public/Set-SqlDscAudit.ps1 @@ -74,9 +74,25 @@ .PARAMETER PassThru If specified the changed audit object will be returned. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts a SQL Server server object via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.Audit` + + Accepts a SQL Server audit object via the pipeline. + .OUTPUTS - `[Microsoft.SqlServer.Management.Smo.Audit]` is passing parameter **PassThru**, - otherwise none. + `Microsoft.SqlServer.Management.Smo.Audit` + + Returns the updated audit object when using the **PassThru** parameter. + + .OUTPUTS + None. + + No output when the **PassThru** parameter is not specified. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' diff --git a/source/Public/Set-SqlDscConfigurationOption.ps1 b/source/Public/Set-SqlDscConfigurationOption.ps1 index 20b0b8c2d6..2c21f208e2 100644 --- a/source/Public/Set-SqlDscConfigurationOption.ps1 +++ b/source/Public/Set-SqlDscConfigurationOption.ps1 @@ -45,7 +45,8 @@ Sets the "cost threshold for parallelism" configuration option to 25 without prompting for confirmation. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` + SQL Server Management Objects (SMO) Server object representing a SQL Server instance. .OUTPUTS diff --git a/source/Public/Set-SqlDscDatabaseDefault.ps1 b/source/Public/Set-SqlDscDatabaseDefault.ps1 index 3bd898a2b6..b1490b88f6 100644 --- a/source/Public/Set-SqlDscDatabaseDefault.ps1 +++ b/source/Public/Set-SqlDscDatabaseDefault.ps1 @@ -59,14 +59,22 @@ Sets multiple default objects for the database named **MyDatabase**. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` + Server object accepted from the pipeline (ServerObject parameter set). - Microsoft.SqlServer.Management.Smo.Database + .INPUTS + `Microsoft.SqlServer.Management.Smo.Database` + Database object accepted from the pipeline (DatabaseObject parameter set). .OUTPUTS - None. But when **PassThru** is specified the output is `[Microsoft.SqlServer.Management.Smo.Database]`. + None. + + .OUTPUTS + `Microsoft.SqlServer.Management.Smo.Database` + + When **PassThru** is specified. #> function Set-SqlDscDatabaseDefault { diff --git a/source/Public/Set-SqlDscDatabaseOwner.ps1 b/source/Public/Set-SqlDscDatabaseOwner.ps1 index dde31e01e0..2d97de6747 100644 --- a/source/Public/Set-SqlDscDatabaseOwner.ps1 +++ b/source/Public/Set-SqlDscDatabaseOwner.ps1 @@ -68,14 +68,17 @@ Sets the owner and returns the updated database object. .INPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` The database object to modify (from Get-SqlDscDatabase). .OUTPUTS None. - When PassThru is specified the output is [Microsoft.SqlServer.Management.Smo.Database]. + .OUTPUTS + `Microsoft.SqlServer.Management.Smo.Database` + + When PassThru is specified. #> function Set-SqlDscDatabaseOwner { diff --git a/source/Public/Set-SqlDscDatabasePermission.ps1 b/source/Public/Set-SqlDscDatabasePermission.ps1 index 433cdb3a25..a0f53d6b7a 100644 --- a/source/Public/Set-SqlDscDatabasePermission.ps1 +++ b/source/Public/Set-SqlDscDatabasePermission.ps1 @@ -31,6 +31,11 @@ .PARAMETER Force Specifies that the permissions should be set without any confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + The SQL Server instance connection object to configure. + .OUTPUTS None. diff --git a/source/Public/Set-SqlDscDatabaseProperty.ps1 b/source/Public/Set-SqlDscDatabaseProperty.ps1 index 133d5fc6ed..d87ca2e19b 100644 --- a/source/Public/Set-SqlDscDatabaseProperty.ps1 +++ b/source/Public/Set-SqlDscDatabaseProperty.ps1 @@ -291,7 +291,7 @@ Sets the compatibility level and trustworthy property of the database without prompting for confirmation. .INPUTS - `[Microsoft.SqlServer.Management.Smo.Database]` + `Microsoft.SqlServer.Management.Smo.Database` The database object to modify (from Get-SqlDscDatabase). @@ -301,7 +301,7 @@ When PassThru is not specified, no output is returned. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` When PassThru is specified, returns the updated database object. diff --git a/source/Public/Set-SqlDscServerPermission.ps1 b/source/Public/Set-SqlDscServerPermission.ps1 index f44120dd58..730ff1cb0c 100644 --- a/source/Public/Set-SqlDscServerPermission.ps1 +++ b/source/Public/Set-SqlDscServerPermission.ps1 @@ -28,6 +28,11 @@ .PARAMETER Force Specifies that the permissions should be set without any confirmation. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS None. diff --git a/source/Public/Set-SqlDscStartupParameter.ps1 b/source/Public/Set-SqlDscStartupParameter.ps1 index 986e6b8c37..cc435c7311 100644 --- a/source/Public/Set-SqlDscStartupParameter.ps1 +++ b/source/Public/Set-SqlDscStartupParameter.ps1 @@ -35,20 +35,27 @@ .EXAMPLE $serviceObject = Get-SqlDscManagedComputerService -ServiceType 'DatabaseEngine' - Set-SqlDscTraceFlag -ServiceObject $serviceObject -TraceFlag 4199 + Set-SqlDscStartupParameter -ServiceObject $serviceObject -TraceFlag 4199 Replaces the trace flags with 4199 on the Database Engine default instance on the server where the command in run. .EXAMPLE - Set-SqlDscTraceFlag -InstanceName 'SQL2022' -TraceFlag @() + Set-SqlDscStartupParameter -InstanceName 'SQL2022' -TraceFlag @() Removes all the trace flags from the Database Engine instance 'SQL2022' on the server where the command in run. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.Service` + + Accepts input via the pipeline. + .OUTPUTS None. + This command does not generate any output. + .NOTES This command should support setting the values according to this documentation: https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/database-engine-service-startup-options diff --git a/source/Public/Set-SqlDscTraceFlag.ps1 b/source/Public/Set-SqlDscTraceFlag.ps1 index a5f3c9ea49..d23c872495 100644 --- a/source/Public/Set-SqlDscTraceFlag.ps1 +++ b/source/Public/Set-SqlDscTraceFlag.ps1 @@ -53,6 +53,11 @@ Removes all the trace flags from the Database Engine instance 'SQL2022' on the server where the command in run. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Wmi.Service` + + Accepts input via the pipeline. + .OUTPUTS None. #> diff --git a/source/Public/Suspend-SqlDscDatabase.ps1 b/source/Public/Suspend-SqlDscDatabase.ps1 index 66f7da173e..3428358d58 100644 --- a/source/Public/Suspend-SqlDscDatabase.ps1 +++ b/source/Public/Suspend-SqlDscDatabase.ps1 @@ -61,12 +61,12 @@ Takes the database offline using pipeline input, forcing disconnection of any active users. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` The server object from Connect-SqlDscDatabaseEngine. .INPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` The database object to take offline (from Get-SqlDscDatabase). @@ -76,7 +76,7 @@ By default, no output is returned. .OUTPUTS - Microsoft.SqlServer.Management.Smo.Database + `Microsoft.SqlServer.Management.Smo.Database` When PassThru is specified, the updated database object is returned. #> diff --git a/source/Public/Test-SqlDscAgentAlertProperty.ps1 b/source/Public/Test-SqlDscAgentAlertProperty.ps1 index 475107c3ab..30cbc3b451 100644 --- a/source/Public/Test-SqlDscAgentAlertProperty.ps1 +++ b/source/Public/Test-SqlDscAgentAlertProperty.ps1 @@ -25,17 +25,19 @@ If specified, the command will return $true only if the alert exists and has this message ID. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .INPUTS - Microsoft.SqlServer.Management.Smo.Agent.Alert + `Microsoft.SqlServer.Management.Smo.Agent.Alert` SQL Agent Alert object. .OUTPUTS - [System.Boolean] + `System.Boolean` + + Returns `$true` if the alert has the specified properties; otherwise `$false`. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' diff --git a/source/Public/Test-SqlDscConfigurationOption.ps1 b/source/Public/Test-SqlDscConfigurationOption.ps1 index 5d858b05b9..8687cd502b 100644 --- a/source/Public/Test-SqlDscConfigurationOption.ps1 +++ b/source/Public/Test-SqlDscConfigurationOption.ps1 @@ -35,11 +35,13 @@ Tests if the "max degree of parallelism" option is set to 4. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` + SQL Server Management Objects (SMO) Server object representing a SQL Server instance. .OUTPUTS - System.Boolean + `System.Boolean` + Returns $true if the configuration option has the specified value, $false otherwise. .NOTES diff --git a/source/Public/Test-SqlDscDatabaseProperty.ps1 b/source/Public/Test-SqlDscDatabaseProperty.ps1 index e344c2b2ff..1c57201fcf 100644 --- a/source/Public/Test-SqlDscDatabaseProperty.ps1 +++ b/source/Public/Test-SqlDscDatabaseProperty.ps1 @@ -491,12 +491,14 @@ Tests multiple database properties at once. Switch parameters can be explicitly set to $false using the colon syntax. .INPUTS - `[Microsoft.SqlServer.Management.Smo.Database]` + `Microsoft.SqlServer.Management.Smo.Database` The database object to test properties for (from Get-SqlDscDatabase). .OUTPUTS - `[System.Boolean]` + `System.Boolean` + + Returns `$true` if the database properties are in the desired state; otherwise `$false`. #> function Test-SqlDscDatabaseProperty { diff --git a/source/Public/Test-SqlDscIsAgentAlert.ps1 b/source/Public/Test-SqlDscIsAgentAlert.ps1 index 69a61597b5..848df3c3cf 100644 --- a/source/Public/Test-SqlDscIsAgentAlert.ps1 +++ b/source/Public/Test-SqlDscIsAgentAlert.ps1 @@ -13,12 +13,14 @@ Specifies the name of the SQL Agent Alert to test. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .OUTPUTS - [System.Boolean] + `System.Boolean` + + Returns the output object. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' diff --git a/source/Public/Test-SqlDscIsAgentOperator.ps1 b/source/Public/Test-SqlDscIsAgentOperator.ps1 index f67109a245..9bc6a7c1fc 100644 --- a/source/Public/Test-SqlDscIsAgentOperator.ps1 +++ b/source/Public/Test-SqlDscIsAgentOperator.ps1 @@ -19,12 +19,12 @@ sure the **ServerObject** is recent enough. .INPUTS - Microsoft.SqlServer.Management.Smo.Server + `Microsoft.SqlServer.Management.Smo.Server` SQL Server Database Engine instance object. .OUTPUTS - System.Boolean + `System.Boolean` Returns $true if the operator exists, $false otherwise. diff --git a/source/Public/Test-SqlDscIsDatabase.ps1 b/source/Public/Test-SqlDscIsDatabase.ps1 index 2d39b1cfe2..0e6a6703ca 100644 --- a/source/Public/Test-SqlDscIsDatabase.ps1 +++ b/source/Public/Test-SqlDscIsDatabase.ps1 @@ -32,12 +32,12 @@ the server object's databases collection first. .OUTPUTS - `[System.Boolean]` + `System.Boolean` Returns `$true` if the target object is a database; otherwise, `$false`. .INPUTS - `[Microsoft.SqlServer.Management.Smo.Server]` + `Microsoft.SqlServer.Management.Smo.Server` The server object can be provided via the pipeline to **ServerObject**. #> diff --git a/source/Public/Test-SqlDscIsDatabasePrincipal.ps1 b/source/Public/Test-SqlDscIsDatabasePrincipal.ps1 index 13935b2b4a..96a503f108 100644 --- a/source/Public/Test-SqlDscIsDatabasePrincipal.ps1 +++ b/source/Public/Test-SqlDscIsDatabasePrincipal.ps1 @@ -38,8 +38,15 @@ **ExcludeRoles**, **ExcludeApplicationRoles**), only the collections that will be used are refreshed to improve performance. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - [System.Boolean] + `System.Boolean` + + Returns the output object. .EXAMPLE $serverInstance = Connect-SqlDscDatabaseEngine diff --git a/source/Public/Test-SqlDscIsLogin.ps1 b/source/Public/Test-SqlDscIsLogin.ps1 index c9b15b0f8e..c59cd39104 100644 --- a/source/Public/Test-SqlDscIsLogin.ps1 +++ b/source/Public/Test-SqlDscIsLogin.ps1 @@ -11,8 +11,15 @@ .PARAMETER Name Specifies the name of the server principal. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - [System.Boolean] + `System.Boolean` + + Returns $true if the principal exists as a login; otherwise $false. .EXAMPLE $serverInstance = Connect-SqlDscDatabaseEngine diff --git a/source/Public/Test-SqlDscIsLoginEnabled.ps1 b/source/Public/Test-SqlDscIsLoginEnabled.ps1 index c43cf14459..e3de98b8b2 100644 --- a/source/Public/Test-SqlDscIsLoginEnabled.ps1 +++ b/source/Public/Test-SqlDscIsLoginEnabled.ps1 @@ -24,18 +24,19 @@ sure the **ServerObject** is recent enough, or pass in **LoginObject**. .INPUTS - [Microsoft.SqlServer.Management.Smo.Server] + `Microsoft.SqlServer.Management.Smo.Server` Server object accepted from the pipeline. - [Microsoft.SqlServer.Management.Smo.Login] + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` Login object accepted from the pipeline. .OUTPUTS - [System.Boolean] + `System.Boolean` - Returns $true if the login is enabled, $false if the login is disabled. + Returns $true if the login is enabled; otherwise $false. .EXAMPLE $serverObject = Connect-SqlDscDatabaseEngine -InstanceName 'MyInstance' diff --git a/source/Public/Test-SqlDscIsRole.ps1 b/source/Public/Test-SqlDscIsRole.ps1 index d78aa658d2..a47803bed5 100644 --- a/source/Public/Test-SqlDscIsRole.ps1 +++ b/source/Public/Test-SqlDscIsRole.ps1 @@ -11,8 +11,15 @@ .PARAMETER Name Specifies the name of the server principal. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Server` + + Accepts input via the pipeline. + .OUTPUTS - [System.Boolean] + `System.Boolean` + + Returns the output object. .EXAMPLE $serverInstance = Connect-SqlDscDatabaseEngine diff --git a/source/Public/Test-SqlDscIsSupportedFeature.ps1 b/source/Public/Test-SqlDscIsSupportedFeature.ps1 index 61d911810f..e8331185c9 100644 --- a/source/Public/Test-SqlDscIsSupportedFeature.ps1 +++ b/source/Public/Test-SqlDscIsSupportedFeature.ps1 @@ -17,8 +17,15 @@ Returns $true if the feature is supported. + .INPUTS + `System.String` + + Accepts input via the pipeline. + .OUTPUTS - [System.Boolean] + `System.Boolean` + + Returns the output object. #> function Test-SqlDscIsSupportedFeature { diff --git a/source/Public/Test-SqlDscRSInstalled.ps1 b/source/Public/Test-SqlDscRSInstalled.ps1 index 21edd185db..0dc3727e3c 100644 --- a/source/Public/Test-SqlDscRSInstalled.ps1 +++ b/source/Public/Test-SqlDscRSInstalled.ps1 @@ -24,8 +24,12 @@ Tests if a Power BI Report Server instance named 'PBIRS' is installed. Returns $true if the instance exists and $false if it does not. + + .INPUTS + None. + .OUTPUTS - System.Boolean + `System.Boolean` Returns $true if the specified instance exists and $false if it does not. #> diff --git a/source/Public/Test-SqlDscServerPermission.ps1 b/source/Public/Test-SqlDscServerPermission.ps1 index c160a517b7..3861a37c0e 100644 --- a/source/Public/Test-SqlDscServerPermission.ps1 +++ b/source/Public/Test-SqlDscServerPermission.ps1 @@ -39,8 +39,20 @@ When this parameter is not used, the test will return true if the specified permissions are present, regardless of any additional permissions. + .INPUTS + `Microsoft.SqlServer.Management.Smo.Login` + + Accepts input via the pipeline. + + .INPUTS + `Microsoft.SqlServer.Management.Smo.ServerRole` + + Accepts input via the pipeline. + .OUTPUTS - [System.Boolean] + `System.Boolean` + + Returns $true if the permissions are in the desired state; otherwise $false. .EXAMPLE $serverInstance = Connect-SqlDscDatabaseEngine diff --git a/source/Public/Uninstall-SqlDscBIReportServer.ps1 b/source/Public/Uninstall-SqlDscBIReportServer.ps1 index 0972044c1b..aa42fdf150 100644 --- a/source/Public/Uninstall-SqlDscBIReportServer.ps1 +++ b/source/Public/Uninstall-SqlDscBIReportServer.ps1 @@ -29,9 +29,18 @@ .PARAMETER PassThru If specified the command will return the setup process exit code. + .INPUTS + None. + .OUTPUTS - When PassThru is specified the function will return the setup process exit - code as System.Int32. Otherwise, the function does not generate any output. + `System.Int32` + + The setup process exit code when PassThru is specified. + + .OUTPUTS + None. + + No output when PassThru is not specified. .EXAMPLE Uninstall-SqlDscBIReportServer -MediaPath 'E:\PowerBIReportServer.exe' diff --git a/source/Public/Uninstall-SqlDscReportingService.ps1 b/source/Public/Uninstall-SqlDscReportingService.ps1 index a634585c1c..b085ed613e 100644 --- a/source/Public/Uninstall-SqlDscReportingService.ps1 +++ b/source/Public/Uninstall-SqlDscReportingService.ps1 @@ -30,9 +30,18 @@ .PARAMETER PassThru Specifies whether the command will return the setup process exit code. + .INPUTS + None. + .OUTPUTS - When PassThru is specified the function will return the setup process exit - code as System.Int32. Otherwise, the function does not generate any output. + `System.Int32` + + The setup process exit code when PassThru is specified. + + .OUTPUTS + None. + + No output when PassThru is not specified. .EXAMPLE Uninstall-SqlDscReportingService -MediaPath 'E:\SQLServerReportingServices.exe' diff --git a/source/Public/Uninstall-SqlDscServer.ps1 b/source/Public/Uninstall-SqlDscServer.ps1 index 59e3984e5f..b2c609a018 100644 --- a/source/Public/Uninstall-SqlDscServer.ps1 +++ b/source/Public/Uninstall-SqlDscServer.ps1 @@ -34,6 +34,9 @@ .LINK https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-from-the-command-prompt + .INPUTS + None. + .OUTPUTS None.