Skip to content

Commit 89a7ae1

Browse files
Robert Holtrjmholt
authored andcommitted
Fix Get-TypeAccelerators
1 parent b41f0eb commit 89a7ae1

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

PSCompatibilityCollector/Tests/UtilityApi.Tests.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ function Get-TypeNameAstFromScript
1313
return $typeExpAst.TypeName
1414
}
1515

16+
function Get-TypeAccelerators
17+
{
18+
[psobject].Assembly.GetType('System.Management.Automation.TypeAccelerators', 'nonpublic')::Get.GetEnumerator()
19+
}
20+
1621
Describe "Type name serialization" {
1722
BeforeAll {
1823
$typeNameTestCases = @(
@@ -62,8 +67,8 @@ Describe "Type name serialization" {
6267

6368
Describe "Type accelerator expansion" {
6469
BeforeAll {
65-
$typeAccelerators = (Get-TypeAccelerators).GetEnumerator() `
66-
| ForEach-Object { $d = New-Object 'System.Collections.Generic.Dictionary[string,string]' } { $d.Add($_.Key, $_.Value.FullName) } { $d }
70+
$typeAccelerators = Get-TypeAccelerators |
71+
ForEach-Object { $d = New-Object 'System.Collections.Generic.Dictionary[string,string]' } { $d.Add($_.Key, $_.Value.FullName) } { $d }
6772

6873
$typeAcceleratorTestCases = @(
6974
@{ Raw = "[System.Exception]"; Expanded = "System.Exception" }

0 commit comments

Comments
 (0)