File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,28 @@ namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands
18
18
{
19
19
using PSSASettings = Microsoft . Windows . PowerShell . ScriptAnalyzer . Settings ;
20
20
21
+ /// <summary>
22
+ /// A cmdlet to format a PowerShell script text.
23
+ /// </summary>
21
24
[ Cmdlet ( VerbsLifecycle . Invoke , "Formatter" ) ]
22
25
public class InvokeFormatterCommand : PSCmdlet , IOutputWriter
23
26
{
24
27
private const string defaultSettingsPreset = "CodeFormatting" ;
25
28
private Settings defaultSettings ;
26
29
private Settings inputSettings ;
27
30
31
+ /// <summary>
32
+ /// The script text to be formated.
33
+ ///
34
+ /// *NOTE*: Unlike ScriptBlock parameter, the ScriptDefinition parameter require a string value.
35
+ /// </summary>
28
36
[ ParameterAttribute ( Mandatory = true ) ]
29
37
[ ValidateNotNull ]
30
38
public string ScriptDefinition { get ; set ; }
31
39
40
+ /// <summary>
41
+ /// A settings hashtable or a path to a PowerShell data file (.psd1) file that contains the settings.
42
+ /// </summary>
32
43
[ Parameter ( Mandatory = false ) ]
33
44
[ ValidateNotNull ]
34
45
public object Settings { get ; set ; }
Original file line number Diff line number Diff line change 3
3
4
4
namespace Microsoft . Windows . PowerShell . ScriptAnalyzer
5
5
{
6
+ /// <summary>
7
+ /// A class to provide code formatting capability.
8
+ /// </summary>
6
9
public class Formatter
7
10
{
11
+ /// <summary>
12
+ /// Format a powershell script.
13
+ /// </summary>
14
+ /// <param name="scriptDefinition">A string representing a powershell script.</param>
15
+ /// <param name="settings">Settings to be used for formatting</param>
16
+ /// <param name="range">The range in which formatting should take place.</param>
17
+ /// <param name="cmdlet">The cmdlet object that calls this method.</param>
18
+ /// <returns></returns>
8
19
public static string Format < TCmdlet > (
9
20
string scriptDefinition ,
10
21
Settings settings ,
You can’t perform that action at this time.
0 commit comments