@@ -33,6 +33,7 @@ public class InvokeFormatterCommand : PSCmdlet, IOutputWriter
33
33
[ ValidateNotNull ]
34
34
public object Settings { get ; set ; }
35
35
36
+ #if DEBUG
36
37
[ Parameter ( Mandatory = false ) ]
37
38
public Range Range { get ; set ; }
38
39
@@ -45,7 +46,6 @@ public class InvokeFormatterCommand : PSCmdlet, IOutputWriter
45
46
[ Parameter ( Mandatory = false , ParameterSetName = "NoRange" ) ]
46
47
public int EndColumnNumber { get ; set ; } = - 1 ;
47
48
48
- #if DEBUG
49
49
/// <summary>
50
50
/// Attaches to an instance of a .Net debugger
51
51
/// </summary>
@@ -94,16 +94,20 @@ protected override void BeginProcessing()
94
94
95
95
protected override void ProcessRecord ( )
96
96
{
97
- // todo add range parameter
98
97
// todo add tests to check range formatting
98
+ string formattedScriptDefinition ;
99
+ #if DEBUG
99
100
var range = Range ;
100
101
if ( this . ParameterSetName . Equals ( "NoRange" ) )
101
102
{
102
103
range = new Range ( StartLineNumber , StartColumnNumber , EndLineNumber , EndColumnNumber ) ;
103
104
}
104
105
105
- var text = Formatter . Format ( ScriptDefinition , inputSettings , range , this ) ;
106
- this . WriteObject ( text ) ;
106
+ formattedScriptDefinition = Formatter . Format ( ScriptDefinition , inputSettings , range , this ) ;
107
+ #endif // DEBUG
108
+
109
+ formattedScriptDefinition = Formatter . Format ( ScriptDefinition , inputSettings , null , this ) ;
110
+ this . WriteObject ( formattedScriptDefinition ) ;
107
111
}
108
112
109
113
private void ValidateInputSettings ( )
0 commit comments