From a101343ea4b6502d666073381e77c57c5cfc2239 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Mon, 12 Jun 2017 19:20:29 -0700 Subject: [PATCH 01/15] Make Range parameter take Range type of int[] type arg --- Engine/Commands/InvokeFormatterCommand.cs | 64 +++++++++++++++-------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index 4b8278ca3..010ddbc65 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -26,6 +26,7 @@ public class InvokeFormatterCommand : PSCmdlet, IOutputWriter { private const string defaultSettingsPreset = "CodeFormatting"; private Settings inputSettings; + private Range range; /// /// The script text to be formated. @@ -43,19 +44,10 @@ public class InvokeFormatterCommand : PSCmdlet, IOutputWriter [ValidateNotNull] public object Settings { get; set; } = defaultSettingsPreset; -#if DEBUG [Parameter(Mandatory = false)] - public Range Range { get; set; } - - [Parameter(Mandatory = false, ParameterSetName = "NoRange")] - public int StartLineNumber { get; set; } = -1; - [Parameter(Mandatory = false, ParameterSetName = "NoRange")] - public int StartColumnNumber { get; set; } = -1; - [Parameter(Mandatory = false, ParameterSetName = "NoRange")] - public int EndLineNumber { get; set; } = -1; - [Parameter(Mandatory = false, ParameterSetName = "NoRange")] - public int EndColumnNumber { get; set; } = -1; - + [ValidateNotNull] + public object Range { get; set; } +#if DEBUG /// /// Attaches to an instance of a .Net debugger /// @@ -85,6 +77,22 @@ protected override void BeginProcessing() } #endif + if (Range != null) + { + try + { + range = GetRange(Range); + } + catch (Exception e) + { + this.ThrowTerminatingError(new ErrorRecord( + e, + "RANGE_ERROR", + ErrorCategory.InvalidArgument, + Range)); + } + } + try { inputSettings = PSSASettings.Create(Settings, this.MyInvocation.PSScriptRoot, this); @@ -93,7 +101,7 @@ protected override void BeginProcessing() { this.ThrowTerminatingError(new ErrorRecord( e, - "SETTNGS_ERROR", + "SETTINGS_ERROR", ErrorCategory.InvalidData, Settings)); } @@ -114,18 +122,30 @@ protected override void ProcessRecord() { // todo add tests to check range formatting string formattedScriptDefinition; -#if DEBUG - var range = Range; - if (this.ParameterSetName.Equals("NoRange")) + formattedScriptDefinition = Formatter.Format(ScriptDefinition, inputSettings, range, this); + this.WriteObject(formattedScriptDefinition); + } + + private static Range GetRange(object rangeObj) + { + var range = rangeObj as Range; + if (range == null) { - range = new Range(StartLineNumber, StartColumnNumber, EndLineNumber, EndColumnNumber); - } + var intArr = rangeObj as int[]; + if (intArr == null) + { + throw new ArgumentException("Argument should be of type Range or int[]."); + } - formattedScriptDefinition = Formatter.Format(ScriptDefinition, inputSettings, range, this); -#endif // DEBUG + if (intArr.Length != 4) + { + throw new ArgumentException("Integer array should be of length 4."); + } - formattedScriptDefinition = Formatter.Format(ScriptDefinition, inputSettings, null, this); - this.WriteObject(formattedScriptDefinition); + range = new Range(intArr[0], intArr[1], intArr[2], intArr[3]); + } + + return range; } private void ValidateInputSettings() From 016f0d40ef0411833a64b3c5742f25f6a210483e Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Mon, 12 Jun 2017 19:44:50 -0700 Subject: [PATCH 02/15] Fix processing Range parameter --- Engine/Commands/InvokeFormatterCommand.cs | 70 +++++++++++++++-------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index 010ddbc65..dee9b84ac 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -12,6 +12,7 @@ using System; using System.Globalization; +using System.Linq; using System.Management.Automation; namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands @@ -77,20 +78,17 @@ protected override void BeginProcessing() } #endif - if (Range != null) + try { - try - { - range = GetRange(Range); - } - catch (Exception e) - { - this.ThrowTerminatingError(new ErrorRecord( - e, - "RANGE_ERROR", - ErrorCategory.InvalidArgument, - Range)); - } + range = GetRange(); + } + catch (Exception e) + { + this.ThrowTerminatingError(new ErrorRecord( + e, + "RANGE_ERROR", + ErrorCategory.InvalidArgument, + Range)); } try @@ -126,26 +124,50 @@ protected override void ProcessRecord() this.WriteObject(formattedScriptDefinition); } - private static Range GetRange(object rangeObj) + private Range GetRange() { - var range = rangeObj as Range; - if (range == null) + if (Range == null) + { + return null; + } + + var range = Range as Range; + if (range != null) + { + return range; + } + + var objArr = Range as object[]; + int[] intArr; + if (objArr == null) { - var intArr = rangeObj as int[]; + // todo check passing int[] casted parameter + intArr = Range as int[]; if (intArr == null) { - throw new ArgumentException("Argument should be of type Range or int[]."); + throw new ArgumentException( + "Argument should be of type Range or object[] or int[].", + nameof(Range)); } + } - if (intArr.Length != 4) - { - throw new ArgumentException("Integer array should be of length 4."); - } + if (objArr.Length != 4) + { + throw new ArgumentException( + "Array should be of length 4.", + nameof(Range)); + } - range = new Range(intArr[0], intArr[1], intArr[2], intArr[3]); + if (!objArr.All(x => x is int)) + { + throw new ArgumentException( + "Array should contain integer elements.", + nameof(Range)); } - return range; + intArr = new int[objArr.Length]; + objArr.CopyTo(intArr, 0); + return new Range(intArr[0], intArr[1], intArr[2], intArr[3]); } private void ValidateInputSettings() From 470311bbc8d75f4c641d476a09bace93f1d5bda7 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 11:15:49 -0700 Subject: [PATCH 03/15] Update range processing algorithm --- Engine/Commands/InvokeFormatterCommand.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index dee9b84ac..8fce57cc3 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -48,6 +48,7 @@ public class InvokeFormatterCommand : PSCmdlet, IOutputWriter [Parameter(Mandatory = false)] [ValidateNotNull] public object Range { get; set; } + #if DEBUG /// /// Attaches to an instance of a .Net debugger @@ -80,7 +81,7 @@ protected override void BeginProcessing() try { - range = GetRange(); + SetRange(); } catch (Exception e) { @@ -124,17 +125,19 @@ protected override void ProcessRecord() this.WriteObject(formattedScriptDefinition); } - private Range GetRange() + private void SetRange() { if (Range == null) { - return null; + this.range = null; + return; } var range = Range as Range; if (range != null) { - return range; + this.range = range; + return; } var objArr = Range as object[]; @@ -167,7 +170,7 @@ private Range GetRange() intArr = new int[objArr.Length]; objArr.CopyTo(intArr, 0); - return new Range(intArr[0], intArr[1], intArr[2], intArr[3]); + this.range = new Range(intArr[0], intArr[1], intArr[2], intArr[3]); } private void ValidateInputSettings() From 03cdb793c57a9fa8d70df33713cd006b7b5290bf Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 11:50:24 -0700 Subject: [PATCH 04/15] Add tests to verify Range parameters --- Engine/Commands/InvokeFormatterCommand.cs | 5 ++- Tests/Engine/InvokeFormatter.tests.ps1 | 40 +++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index 8fce57cc3..a320de0df 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -133,7 +133,10 @@ private void SetRange() return; } - var range = Range as Range; + // When the range object is constructed with `[range]::new syntax`, `Range as Range` cast works. + // However, if the range object is constructed with `new-object "range"` syntax, then + // we need to use the ImmediatedBaseObject property to cast. + var range = (Range as Range ?? (Range as PSObject)?.ImmediateBaseObject as Range); if (range != null) { this.range = range; diff --git a/Tests/Engine/InvokeFormatter.tests.ps1 b/Tests/Engine/InvokeFormatter.tests.ps1 index 56764047d..b8e04d577 100644 --- a/Tests/Engine/InvokeFormatter.tests.ps1 +++ b/Tests/Engine/InvokeFormatter.tests.ps1 @@ -31,6 +31,46 @@ function foo { Invoke-Formatter $def $settings | Should Be $expected } } + + Context "When a range is given" { + It "Should format only within the range when a range list is given" { + $def = @" +function foo { +"xyz" +"abc" +} +"@ + + $expected = @" +function foo { +"xyz" + "abc" +} +"@ + + Invoke-Formatter -ScriptDefinition $def -Range @(3, 1, 4, 1) | Should Be $expected + } + + It "Should format only within the range when a range object is given" { + $def = @" +function foo { +"xyz" +"abc" +} +"@ + + $expected = @" +function foo { +"xyz" + "abc" +} +"@ + + $range = New-Object -TypeName "Microsoft.Windows.PowerShell.ScriptAnalyzer.Range" -ArgumentList 3, 1, 4, 1 + Invoke-Formatter -ScriptDefinition $def -Range $range | Should Be $expected + } + } + Context "When no settings are given" { It "Should format using default settings" { $def = @' From 10742f9f32db827425c47ad4678f93184e750aa3 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 14:01:49 -0700 Subject: [PATCH 05/15] Fix range parameter processing --- Engine/Commands/InvokeFormatterCommand.cs | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index a320de0df..c4053b0bc 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -145,7 +145,18 @@ private void SetRange() var objArr = Range as object[]; int[] intArr; - if (objArr == null) + if (objArr != null) + { + if (!objArr.All(x => x is int)) + { + throw new ArgumentException( + "Array should contain integer elements.", + nameof(Range)); + } + intArr = new int[objArr.Length]; + objArr.CopyTo(intArr, 0); + } + else { // todo check passing int[] casted parameter intArr = Range as int[]; @@ -157,22 +168,13 @@ private void SetRange() } } - if (objArr.Length != 4) + if (intArr.Length != 4) { throw new ArgumentException( "Array should be of length 4.", nameof(Range)); } - if (!objArr.All(x => x is int)) - { - throw new ArgumentException( - "Array should contain integer elements.", - nameof(Range)); - } - - intArr = new int[objArr.Length]; - objArr.CopyTo(intArr, 0); this.range = new Range(intArr[0], intArr[1], intArr[2], intArr[3]); } From 9005f7c0bfcc50826372b1075837bbcf1d297552 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 14:17:36 -0700 Subject: [PATCH 06/15] Add a range validator public method to EditableText class --- Engine/EditableText.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Engine/EditableText.cs b/Engine/EditableText.cs index b93dc33dd..74b2fcf3a 100644 --- a/Engine/EditableText.cs +++ b/Engine/EditableText.cs @@ -106,6 +106,14 @@ public EditableText ApplyEdit(TextEdit textEdit) // TODO Add a method that takes multiple edits, checks if they are unique and applies them. + public bool IsValidRange(Range range) + { + return range.Start.Line <= Lines.Length + && range.End.Line <= Lines.Length + && range.Start.Column <= Lines[range.Start.Line - 1].Length + && range.End.Column <= Lines[range.End.Line - 1].Length + 1; + } + public override string ToString() { return Text; @@ -123,10 +131,7 @@ private void ValidateTextEdit(TextEdit textEdit) private void ValidateTextEditExtent(TextEdit textEdit) { - if (textEdit.StartLineNumber > Lines.Length - || textEdit.EndLineNumber > Lines.Length - || textEdit.StartColumnNumber > Lines[textEdit.StartLineNumber - 1].Length - || textEdit.EndColumnNumber > Lines[textEdit.EndLineNumber - 1].Length + 1) + if (IsValidRange(textEdit)) { throw new ArgumentException(String.Format( CultureInfo.CurrentCulture, From f781ca5f9ed9c7e8d1246f837ee5ae8eaca581f2 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 14:18:28 -0700 Subject: [PATCH 07/15] Validate range argument in ScriptAnalyzer.Fix method --- Engine/ScriptAnalyzer.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Engine/ScriptAnalyzer.cs b/Engine/ScriptAnalyzer.cs index ab60859b5..919ba8df0 100644 --- a/Engine/ScriptAnalyzer.cs +++ b/Engine/ScriptAnalyzer.cs @@ -1559,6 +1559,15 @@ public EditableText Fix(EditableText text, Range range, out Range updatedRange) // todo validate range var isRangeNull = range == null; + if (!isRangeNull && !text.IsValidRange(range)) + { + this.outputWriter.ThrowTerminatingError(new ErrorRecord( + new ArgumentException("Invalid Range", nameof(range)), + "FIX_ERROR", + ErrorCategory.InvalidArgument, + range)); + } + range = isRangeNull ? null : SnapToEdges(text, range); var previousLineCount = text.Lines.Length; var previousUnusedCorrections = 0; From ad508a979c459b451fb25f3b440053ff2e98fbd6 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 14:18:58 -0700 Subject: [PATCH 08/15] Change Range parameter type to int[] --- Engine/Commands/InvokeFormatterCommand.cs | 69 +---------------------- 1 file changed, 3 insertions(+), 66 deletions(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index c4053b0bc..4ed9bb57f 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -47,7 +47,8 @@ public class InvokeFormatterCommand : PSCmdlet, IOutputWriter [Parameter(Mandatory = false)] [ValidateNotNull] - public object Range { get; set; } + [ValidateCount(4, 4)] + public int[] Range { get; set; } #if DEBUG /// @@ -79,18 +80,7 @@ protected override void BeginProcessing() } #endif - try - { - SetRange(); - } - catch (Exception e) - { - this.ThrowTerminatingError(new ErrorRecord( - e, - "RANGE_ERROR", - ErrorCategory.InvalidArgument, - Range)); - } + this.range = new Range(Range[0], Range[1], Range[2], Range[3]); try { @@ -125,59 +115,6 @@ protected override void ProcessRecord() this.WriteObject(formattedScriptDefinition); } - private void SetRange() - { - if (Range == null) - { - this.range = null; - return; - } - - // When the range object is constructed with `[range]::new syntax`, `Range as Range` cast works. - // However, if the range object is constructed with `new-object "range"` syntax, then - // we need to use the ImmediatedBaseObject property to cast. - var range = (Range as Range ?? (Range as PSObject)?.ImmediateBaseObject as Range); - if (range != null) - { - this.range = range; - return; - } - - var objArr = Range as object[]; - int[] intArr; - if (objArr != null) - { - if (!objArr.All(x => x is int)) - { - throw new ArgumentException( - "Array should contain integer elements.", - nameof(Range)); - } - intArr = new int[objArr.Length]; - objArr.CopyTo(intArr, 0); - } - else - { - // todo check passing int[] casted parameter - intArr = Range as int[]; - if (intArr == null) - { - throw new ArgumentException( - "Argument should be of type Range or object[] or int[].", - nameof(Range)); - } - } - - if (intArr.Length != 4) - { - throw new ArgumentException( - "Array should be of length 4.", - nameof(Range)); - } - - this.range = new Range(intArr[0], intArr[1], intArr[2], intArr[3]); - } - private void ValidateInputSettings() { // todo implement this From 2e1e1708328a977fbc60e8d960fe5e02c5932557 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 14:30:22 -0700 Subject: [PATCH 09/15] Fix range validation in EditableText --- Engine/EditableText.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/EditableText.cs b/Engine/EditableText.cs index 74b2fcf3a..20380c1ac 100644 --- a/Engine/EditableText.cs +++ b/Engine/EditableText.cs @@ -131,7 +131,7 @@ private void ValidateTextEdit(TextEdit textEdit) private void ValidateTextEditExtent(TextEdit textEdit) { - if (IsValidRange(textEdit)) + if (!IsValidRange(textEdit)) { throw new ArgumentException(String.Format( CultureInfo.CurrentCulture, From 3dcbba6091d667950675492270394fb0f97cd9d6 Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 14:30:44 -0700 Subject: [PATCH 10/15] Fix range object creation --- 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 4ed9bb57f..05299b152 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -80,8 +80,7 @@ protected override void BeginProcessing() } #endif - this.range = new Range(Range[0], Range[1], Range[2], Range[3]); - + this.range = Range == null ? null : new Range(Range[0], Range[1], Range[2], Range[3]); try { inputSettings = PSSASettings.Create(Settings, this.MyInvocation.PSScriptRoot, this); From a1619594a910471bf41e26d71abd4865a3ad830e Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 14:31:08 -0700 Subject: [PATCH 11/15] Update invoke-formatter tests --- Tests/Engine/InvokeFormatter.tests.ps1 | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Tests/Engine/InvokeFormatter.tests.ps1 b/Tests/Engine/InvokeFormatter.tests.ps1 index b8e04d577..17b25a598 100644 --- a/Tests/Engine/InvokeFormatter.tests.ps1 +++ b/Tests/Engine/InvokeFormatter.tests.ps1 @@ -50,25 +50,6 @@ function foo { Invoke-Formatter -ScriptDefinition $def -Range @(3, 1, 4, 1) | Should Be $expected } - - It "Should format only within the range when a range object is given" { - $def = @" -function foo { -"xyz" -"abc" -} -"@ - - $expected = @" -function foo { -"xyz" - "abc" -} -"@ - - $range = New-Object -TypeName "Microsoft.Windows.PowerShell.ScriptAnalyzer.Range" -ArgumentList 3, 1, 4, 1 - Invoke-Formatter -ScriptDefinition $def -Range $range | Should Be $expected - } } Context "When no settings are given" { From b395f92aa0a1fb35dbd4a33e121d61817a0c506c Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 15:44:19 -0700 Subject: [PATCH 12/15] Make Range parameter positional --- Engine/Commands/InvokeFormatterCommand.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Engine/Commands/InvokeFormatterCommand.cs b/Engine/Commands/InvokeFormatterCommand.cs index 05299b152..5d9723df0 100644 --- a/Engine/Commands/InvokeFormatterCommand.cs +++ b/Engine/Commands/InvokeFormatterCommand.cs @@ -45,7 +45,15 @@ public class InvokeFormatterCommand : PSCmdlet, IOutputWriter [ValidateNotNull] public object Settings { get; set; } = defaultSettingsPreset; - [Parameter(Mandatory = false)] + /// + /// The range within which formatting should take place. + /// + /// The parameter is an array of integers of length 4 such that the first, second, third and last + /// elements correspond to the start line number, start column number, end line number and + /// end column number. These numbers must be greater than 0. + /// + /// + [Parameter(Mandatory = false, Position = 3)] [ValidateNotNull] [ValidateCount(4, 4)] public int[] Range { get; set; } From 82de2a777ca648fe24ef77be7625945f07d2195e Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 15:44:52 -0700 Subject: [PATCH 13/15] Add null check for range parameter in IsValidRange --- Engine/EditableText.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Engine/EditableText.cs b/Engine/EditableText.cs index 20380c1ac..7aae0c28a 100644 --- a/Engine/EditableText.cs +++ b/Engine/EditableText.cs @@ -106,14 +106,27 @@ public EditableText ApplyEdit(TextEdit textEdit) // TODO Add a method that takes multiple edits, checks if they are unique and applies them. + /// + /// Checks if the range falls within the bounds of the text. + /// + /// + /// public bool IsValidRange(Range range) { + if (range == null) + { + throw new ArgumentNullException(nameof(range)); + } + return range.Start.Line <= Lines.Length && range.End.Line <= Lines.Length && range.Start.Column <= Lines[range.Start.Line - 1].Length && range.End.Column <= Lines[range.End.Line - 1].Length + 1; } + /// + /// Returns the text representation of the object. + /// public override string ToString() { return Text; From 4777cec8208d620cdaa8f7d677f2618333c1b43a Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Tue, 13 Jun 2017 15:45:20 -0700 Subject: [PATCH 14/15] Update invoke-formatter markdown help documentation --- docs/markdown/Invoke-Formatter.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/markdown/Invoke-Formatter.md b/docs/markdown/Invoke-Formatter.md index e68a4adba..a47a4a5a1 100644 --- a/docs/markdown/Invoke-Formatter.md +++ b/docs/markdown/Invoke-Formatter.md @@ -10,7 +10,7 @@ Formats a script text based on the input settings or default settings. ## SYNTAX ``` -Invoke-Formatter [-ScriptDefinition] [-Settings ] +Invoke-Formatter [-ScriptDefinition] [-Settings ] [-Range ] ``` ## DESCRIPTION @@ -97,3 +97,17 @@ Default value: CodeFormatting Accept pipeline input: False Accept wildcard characters: False ``` + +### -Range +The range within which formatting should take place. The parameter is an array of integers of length 4 such that the first, second, third and last elements correspond to the start line number, start column number, end line number and end column number. These numbers must be greater than 0. + +```yaml +Type: int[] +Parameter Sets: (All) + +Required: False +Position: 3 +Default value: +Accept pipeline input: False +Accept wildcard characters: False +``` From 1ed33fa5863e1a34d8092c5e203b3ab556419a0d Mon Sep 17 00:00:00 2001 From: Kapil Borle Date: Wed, 14 Jun 2017 11:06:34 -0700 Subject: [PATCH 15/15] Update Range parameter type in markdown help --- docs/markdown/Invoke-Formatter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/markdown/Invoke-Formatter.md b/docs/markdown/Invoke-Formatter.md index a47a4a5a1..3eb42b1d8 100644 --- a/docs/markdown/Invoke-Formatter.md +++ b/docs/markdown/Invoke-Formatter.md @@ -102,7 +102,7 @@ Accept wildcard characters: False The range within which formatting should take place. The parameter is an array of integers of length 4 such that the first, second, third and last elements correspond to the start line number, start column number, end line number and end column number. These numbers must be greater than 0. ```yaml -Type: int[] +Type: Int32[] Parameter Sets: (All) Required: False