From bcb71a267c7009b7b48d9a356a433348de8a03db Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 8 Jun 2018 21:02:38 +0100 Subject: [PATCH 1/7] add outputtype to get-scriptanayzerrule --- Engine/Commands/GetScriptAnalyzerRuleCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/Commands/GetScriptAnalyzerRuleCommand.cs b/Engine/Commands/GetScriptAnalyzerRuleCommand.cs index 254f55cc6..60ee1c607 100644 --- a/Engine/Commands/GetScriptAnalyzerRuleCommand.cs +++ b/Engine/Commands/GetScriptAnalyzerRuleCommand.cs @@ -15,6 +15,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands /// GetScriptAnalyzerRuleCommand: Cmdlet to list all the analyzer rule names and descriptions. /// [Cmdlet(VerbsCommon.Get, "ScriptAnalyzerRule", HelpUri = "https://go.microsoft.com/fwlink/?LinkId=525913")] + [OutputType(typeof(RuleInfo))] public class GetScriptAnalyzerRuleCommand : PSCmdlet, IOutputWriter { #region Parameters From 001378b9e42df567d1ed62b4e1775538cac667e5 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 8 Jun 2018 21:05:22 +0100 Subject: [PATCH 2/7] add output type to other cmdlets --- Engine/Commands/InvokeFormatterCommand.cs | 1 + Engine/Commands/InvokeScriptAnalyzerCommand.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index 23d19284c..9c7f1d07e 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -13,6 +13,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands /// A cmdlet to format a PowerShell script text. /// [Cmdlet(VerbsLifecycle.Invoke, "Formatter")] + [OutputType(typeof(RuleInfo))] public class InvokeFormatterCommand : PSCmdlet, IOutputWriter { private const string defaultSettingsPreset = "CodeFormatting"; diff --git a/Engine/Commands/InvokeScriptAnalyzerCommand.cs b/Engine/Commands/InvokeScriptAnalyzerCommand.cs index ae2e0858e..5f9614e47 100644 --- a/Engine/Commands/InvokeScriptAnalyzerCommand.cs +++ b/Engine/Commands/InvokeScriptAnalyzerCommand.cs @@ -24,6 +24,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands DefaultParameterSetName = "File", SupportsShouldProcess = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=525914")] + [OutputType(typeof(DiagnosticRecord))] public class InvokeScriptAnalyzerCommand : PSCmdlet, IOutputWriter { #region Private variables From 419adb818560087a10ab260e632b666c667d84c7 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 8 Jun 2018 21:11:35 +0100 Subject: [PATCH 3/7] add missing using statement --- Engine/Commands/InvokeFormatterCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index 9c7f1d07e..b5bc953b3 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System; using System.Globalization; using System.Management.Automation; From c3ad261849abecbcca89907b03184fec03ff243f Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 8 Jun 2018 21:12:13 +0100 Subject: [PATCH 4/7] fix type for InvokeFormatterCommand --- Engine/Commands/InvokeFormatterCommand.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index b5bc953b3..784e0737b 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System; using System.Globalization; using System.Management.Automation; @@ -14,7 +13,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands /// A cmdlet to format a PowerShell script text. /// [Cmdlet(VerbsLifecycle.Invoke, "Formatter")] - [OutputType(typeof(RuleInfo))] + [OutputType(typeof(string))] public class InvokeFormatterCommand : PSCmdlet, IOutputWriter { private const string defaultSettingsPreset = "CodeFormatting"; From a6d84625784d3f34cab759c166ae53392c0aeecc Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 8 Jun 2018 21:14:20 +0100 Subject: [PATCH 5/7] add another type to invoke-scriptanalyzer cmdlet --- Engine/Commands/InvokeScriptAnalyzerCommand.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/Commands/InvokeScriptAnalyzerCommand.cs b/Engine/Commands/InvokeScriptAnalyzerCommand.cs index 5f9614e47..b2d88611e 100644 --- a/Engine/Commands/InvokeScriptAnalyzerCommand.cs +++ b/Engine/Commands/InvokeScriptAnalyzerCommand.cs @@ -25,6 +25,7 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands SupportsShouldProcess = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=525914")] [OutputType(typeof(DiagnosticRecord))] + [OutputType(typeof(SuppressedRecord))] public class InvokeScriptAnalyzerCommand : PSCmdlet, IOutputWriter { #region Private variables From 447c546e6fd1fd9fcc3f72ad6311a731ad958765 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 8 Jun 2018 21:19:28 +0100 Subject: [PATCH 6/7] Add Outputs to Invoke-Formatter.md documentation --- docs/markdown/Invoke-Formatter.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/markdown/Invoke-Formatter.md b/docs/markdown/Invoke-Formatter.md index 9cf795d3e..acbacc091 100644 --- a/docs/markdown/Invoke-Formatter.md +++ b/docs/markdown/Invoke-Formatter.md @@ -111,3 +111,8 @@ Default value: Accept pipeline input: False Accept wildcard characters: False ``` + +## OUTPUTS + +### System.String +The formatted string result. From 0f7da0e21d1fda7e5ac27541b6ec9d38d5a41261 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Fri, 8 Jun 2018 23:23:53 +0100 Subject: [PATCH 7/7] Trigger Build since to test if AppVeyor issue https://github.com/appveyor/ci/issues/2428 got resolved now by @Wasapl