Skip to content

Commit a54a99c

Browse files
authored
Merge pull request #1020 from bergmeister/OutputType
Add OutputType attributes to cmdlets to enhance tab completion
2 parents dc0b4a3 + 0f7da0e commit a54a99c

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

Engine/Commands/GetScriptAnalyzerRuleCommand.cs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
1515
/// GetScriptAnalyzerRuleCommand: Cmdlet to list all the analyzer rule names and descriptions.
1616
/// </summary>
1717
[Cmdlet(VerbsCommon.Get, "ScriptAnalyzerRule", HelpUri = "https://go.microsoft.com/fwlink/?LinkId=525913")]
18+
[OutputType(typeof(RuleInfo))]
1819
public class GetScriptAnalyzerRuleCommand : PSCmdlet, IOutputWriter
1920
{
2021
#region Parameters

Engine/Commands/InvokeFormatterCommand.cs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
1313
/// A cmdlet to format a PowerShell script text.
1414
/// </summary>
1515
[Cmdlet(VerbsLifecycle.Invoke, "Formatter")]
16+
[OutputType(typeof(string))]
1617
public class InvokeFormatterCommand : PSCmdlet, IOutputWriter
1718
{
1819
private const string defaultSettingsPreset = "CodeFormatting";

Engine/Commands/InvokeScriptAnalyzerCommand.cs

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
2424
DefaultParameterSetName = "File",
2525
SupportsShouldProcess = true,
2626
HelpUri = "https://go.microsoft.com/fwlink/?LinkId=525914")]
27+
[OutputType(typeof(DiagnosticRecord))]
28+
[OutputType(typeof(SuppressedRecord))]
2729
public class InvokeScriptAnalyzerCommand : PSCmdlet, IOutputWriter
2830
{
2931
#region Private variables

docs/markdown/Invoke-Formatter.md

+5
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,8 @@ Default value:
111111
Accept pipeline input: False
112112
Accept wildcard characters: False
113113
```
114+
115+
## OUTPUTS
116+
117+
### System.String
118+
The formatted string result.

0 commit comments

Comments
 (0)