Skip to content

Commit 2737346

Browse files
committed
Update output documentation for cmdlets to clarify return types and conditions
1 parent 12f1994 commit 2737346

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

.github/instructions/dsc-community-style-guidelines-pester.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ applyTo: "**/*.[Tt]ests.ps1"
2828
- Mock variables prefix: 'mock'
2929

3030
## Structure & Scope
31-
- Public commands: Never use `InModuleScope` (unless retrieving localized strings)
31+
- Public commands: Never use `InModuleScope` (unless retrieving localized strings or creating an object using an internal class)
3232
- Private functions/class resources: Always use `InModuleScope`
3333
- Each class method = separate `Context` block
3434
- Each scenario = separate `Context` block

source/Public/Add-SqlDscFileGroup.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,19 @@
2121
Specifies that the FileGroup should be added without confirmation.
2222
2323
.INPUTS
24-
[Microsoft.SqlServer.Management.Smo.FileGroup]
24+
Microsoft.SqlServer.Management.Smo.FileGroup
2525
2626
FileGroup objects that will be added to the Database.
2727
2828
.OUTPUTS
29-
None, or [Microsoft.SqlServer.Management.Smo.FileGroup[]] if PassThru is specified.
29+
None
30+
31+
This cmdlet does not generate output by default.
32+
33+
.OUTPUTS
34+
Microsoft.SqlServer.Management.Smo.FileGroup[]
35+
36+
When the PassThru parameter is specified, returns the FileGroup objects that were added.
3037
3138
.EXAMPLE
3239
Add-SqlDscFileGroup -Database $database -FileGroup $fileGroup

source/Public/New-SqlDscDataFile.ps1

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,19 @@
105105
Creates a DatabaseFileSpec object with all properties set directly via parameters.
106106
107107
.OUTPUTS
108-
None. Unless -PassThru is specified for the Standard or FromSpec parameter
109-
sets, in which case it returns `[Microsoft.SqlServer.Management.Smo.DataFile]`.
110-
When using the -AsSpec parameter, always returns `[DatabaseFileSpec]`.
108+
None
109+
110+
This cmdlet does not generate output by default when using Standard or FromSpec parameter sets without PassThru.
111+
112+
.OUTPUTS
113+
Microsoft.SqlServer.Management.Smo.DataFile
114+
115+
When using the Standard or FromSpec parameter sets with the PassThru parameter.
116+
117+
.OUTPUTS
118+
DatabaseFileSpec
119+
120+
When using the AsSpec parameter to create a specification object.
111121
#>
112122
function New-SqlDscDataFile
113123
{

source/Public/New-SqlDscFileGroup.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,14 @@
7373
Creates a DatabaseFileGroupSpec object with files and properties set directly via parameters.
7474
7575
.OUTPUTS
76-
`[Microsoft.SqlServer.Management.Smo.FileGroup]` or `[DatabaseFileGroupSpec]` if -AsSpec is specified.
76+
Microsoft.SqlServer.Management.Smo.FileGroup
77+
78+
When creating a FileGroup with or without an associated Database (not using -AsSpec).
79+
80+
.OUTPUTS
81+
DatabaseFileGroupSpec
82+
83+
When using the -AsSpec parameter to create a specification object.
7784
#>
7885
function New-SqlDscFileGroup
7986
{

0 commit comments

Comments
 (0)