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
1818{
1919 using PSSASettings = Microsoft . Windows . PowerShell . ScriptAnalyzer . Settings ;
2020
21+ /// <summary>
22+ /// A cmdlet to format a PowerShell script text.
23+ /// </summary>
2124 [ Cmdlet ( VerbsLifecycle . Invoke , "Formatter" ) ]
2225 public class InvokeFormatterCommand : PSCmdlet , IOutputWriter
2326 {
2427 private const string defaultSettingsPreset = "CodeFormatting" ;
2528 private Settings defaultSettings ;
2629 private Settings inputSettings ;
2730
31+ /// <summary>
32+ /// The script text to be formated.
33+ ///
34+ /// *NOTE*: Unlike ScriptBlock parameter, the ScriptDefinition parameter require a string value.
35+ /// </summary>
2836 [ ParameterAttribute ( Mandatory = true ) ]
2937 [ ValidateNotNull ]
3038 public string ScriptDefinition { get ; set ; }
3139
40+ /// <summary>
41+ /// A settings hashtable or a path to a PowerShell data file (.psd1) file that contains the settings.
42+ /// </summary>
3243 [ Parameter ( Mandatory = false ) ]
3344 [ ValidateNotNull ]
3445 public object Settings { get ; set ; }
Original file line number Diff line number Diff line change 33
44namespace Microsoft . Windows . PowerShell . ScriptAnalyzer
55{
6+ /// <summary>
7+ /// A class to provide code formatting capability.
8+ /// </summary>
69 public class Formatter
710 {
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>
819 public static string Format < TCmdlet > (
920 string scriptDefinition ,
1021 Settings settings ,
You can’t perform that action at this time.
0 commit comments