Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/System.Management.Automation/engine/MshMemberInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2757,13 +2757,14 @@ private static Type GetPSMethodProjectedType(Type type, bool isOut = false)

if (type.IsByRef)
{
var elementType = type.GetElementType();
var elementType = GetPSMethodProjectedType(type.GetElementType());
type = isOut ? typeof(PSOutParameter<>).MakeGenericType(elementType)
: typeof(PSReference<>).MakeGenericType(elementType);
}
else if (type.IsPointer)
{
type = typeof(PSPointer<>).MakeGenericType(type.GetElementType());
var elementType = GetPSMethodProjectedType(type.GetElementType());
type = typeof(PSPointer<>).MakeGenericType(elementType);
}

return type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ Describe "Get-Member" -Tags "CI" {

Get-Member -InputObject $o | Should -Not -BeNullOrEmpty
}

It "Should be able to be called on IntPtr" {
$results = [System.IntPtr] | Get-Member -Type Property -Static | Sort-Object -Property Name
$results.Count | Should -BeExactly 2
$results[0].Name | Should -BeExactly 'Size'
$results[1].Name | Should -BeExactly 'Zero'
}
}

Describe "Get-Member DRT Unit Tests" -Tags "CI" {
Expand Down