You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open brace placement should follow a consistent style. It can either follow KR style (on same line) or the Allman style (not on same line).
5
6
6
-
## How to Fix
7
-
8
-
## Example
9
-
### Wrong:
10
-
```PowerShell
7
+
**Note**: This rule is not enabled by default. The user needs to enable it through settings.
11
8
9
+
## Configuration
10
+
```powershell
11
+
Rules = @{
12
+
PSPlaceOpenBrace = @{
13
+
Enable = $true
14
+
OnSameLine = $true
15
+
NewLineAfter = $true
16
+
}
12
17
```
13
18
14
-
### Correct:
15
-
```PowerShell
19
+
### Parameters
16
20
17
-
```
21
+
#### Enable: bool (Default value is `$false`)
22
+
Enable or disable the rule during ScriptAnalyzer invocation.
23
+
24
+
#### OnSameLine: bool (Default value is `$true`)
25
+
Provide an option to enforce the open brace to be on the same line as preceding keyword (KR style) or on the next line (Allman style). The default value is `#true.
26
+
27
+
#### NewLineAfter: bool (Default value is `$true`)
28
+
Enforce a new line character after an open brace. The default value is true.
0 commit comments