Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OutputType attributes to cmdlets to enhance tab completion #1020

Merged
merged 7 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Engine/Commands/GetScriptAnalyzerRuleCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
/// GetScriptAnalyzerRuleCommand: Cmdlet to list all the analyzer rule names and descriptions.
/// </summary>
[Cmdlet(VerbsCommon.Get, "ScriptAnalyzerRule", HelpUri = "https://go.microsoft.com/fwlink/?LinkId=525913")]
[OutputType(typeof(RuleInfo))]
public class GetScriptAnalyzerRuleCommand : PSCmdlet, IOutputWriter
{
#region Parameters
Expand Down
1 change: 1 addition & 0 deletions Engine/Commands/InvokeFormatterCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
/// A cmdlet to format a PowerShell script text.
/// </summary>
[Cmdlet(VerbsLifecycle.Invoke, "Formatter")]
[OutputType(typeof(string))]
public class InvokeFormatterCommand : PSCmdlet, IOutputWriter
{
private const string defaultSettingsPreset = "CodeFormatting";
Expand Down
2 changes: 2 additions & 0 deletions Engine/Commands/InvokeScriptAnalyzerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
DefaultParameterSetName = "File",
SupportsShouldProcess = true,
HelpUri = "https://go.microsoft.com/fwlink/?LinkId=525914")]
[OutputType(typeof(DiagnosticRecord))]
[OutputType(typeof(SuppressedRecord))]
public class InvokeScriptAnalyzerCommand : PSCmdlet, IOutputWriter
{
#region Private variables
Expand Down
5 changes: 5 additions & 0 deletions docs/markdown/Invoke-Formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,8 @@ Default value:
Accept pipeline input: False
Accept wildcard characters: False
```

## OUTPUTS

### System.String
The formatted string result.