File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 5
5
Gets unique templates related to a language.
6
6
#>
7
7
$distinctCommands = @ {}
8
- , @ (foreach ($psProperty in $this.PSObject.properties ) {
8
+ $ThisPSObject = $this.PSObject
9
+ $theseProperties = @ ($this.PSObject.properties )
10
+ foreach ($psProperty in $theseProperties ) {
9
11
if ($psProperty -isnot [psnoteproperty ]) { continue }
10
12
if ($psProperty.Value -isnot [Management.Automation.CommandInfo ]) { continue }
11
- if (
12
- $psProperty .Value -is [ Management.Automation.AliasInfo ] -and
13
- (
14
- $distinctCommands [$psProperty .Value .ResolvedCommand ] -or
15
- $this .PSObject. Properties [$psProperty .Value. ResolvedCommand.Name ]
16
- )
17
- ) {
18
- continue
13
+ if ($psProperty .Value -is [ Management.Automation.AliasInfo ]) {
14
+ $aliasInfo = $psProperty .Value
15
+ if (
16
+ $distinctCommands [$aliasInfo .ResolvedCommand ] -or
17
+ $ThisPSObject . Properties [$aliasInfo . ResolvedCommand.Name -replace ' Template\p{P} ' ]
18
+ ) {
19
+ continue
20
+ }
19
21
}
20
22
$distinctCommands [$psProperty.Value ] = $psProperty.Value
21
23
$psProperty.Value
22
- })
24
+ }
You can’t perform that action at this time.
0 commit comments