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 @@ -2235,21 +2235,23 @@ $distinctCommands = @{}
22352235 Gets unique templates related to a language.
22362236#>
22372237$distinctCommands = @{}
2238- ,@(foreach ($psProperty in $this.PSObject.properties) {
2238+ $ThisPSObject = $this.PSObject
2239+ $theseProperties = @($this.PSObject.properties)
2240+ foreach ($psProperty in $theseProperties) {
22392241 if ($psProperty -isnot [psnoteproperty]) { continue }
22402242 if ($psProperty.Value -isnot [Management.Automation.CommandInfo]) { continue }
2241- if (
2242- $psProperty.Value -is [Management.Automation.AliasInfo] -and
2243- (
2244- $distinctCommands[$psProperty.Value .ResolvedCommand] -or
2245- $this.PSObject. Properties[$psProperty.Value. ResolvedCommand.Name]
2246- )
2247- ) {
2248- continue
2243+ if ($psProperty.Value -is [Management.Automation.AliasInfo]) {
2244+ $aliasInfo = $psProperty.Value
2245+ if (
2246+ $distinctCommands[$aliasInfo .ResolvedCommand] -or
2247+ $ThisPSObject. Properties[$aliasInfo. ResolvedCommand.Name -replace 'Template\p{P}' ]
2248+ ) {
2249+ continue
2250+ }
22492251 }
22502252 $distinctCommands[$psProperty.Value] = $psProperty.Value
22512253 $psProperty.Value
2252- })
2254+ }
22532255 </GetScriptBlock >
22542256 </ScriptProperty >
22552257 </Members >
You can’t perform that action at this time.
0 commit comments