I am trying to use the method DetachBuffer() of Windows.Storage.Streams.DataWriter but PowerShell only recognizes the IBuffer that it supposed to return as __ComObject. I have used other WinRT objects successfully, but this one is giving me trouble.
[void][Windows.Storage.Streams.DataWriter, Windows.Storage.Streams, ContentType = WindowsRuntime]
$dataWriter = [Windows.Storage.Streams.DataWriter]::new()
$dataWriter.WriteByte(0x01)
$buffer = $dataWriter.DetachBuffer()
$buffer
System.__ComObject
$buffer | Get-Member
TypeName: System.__ComObject
Name MemberType Definition
---- ---------- ----------
CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetLifetimeService Method System.Object GetLifetimeService()
GetType Method type GetType()
InitializeLifetimeService Method System.Object InitializeLifetimeService()
ToString Method string ToString()
I am assuming that I need to "import" some WinRT class that DetachBuffer() is actually returning, but I have no clue what it is other than it implements IBuffer interface.