~\Downloads\Microsoft.WinGet.Client-PSModule
❯ $pkgs = Get-WinGetPackage -Source winget | Where IsUpdateAvailable
~\Downloads\Microsoft.WinGet.Client-PSModule
❯ $pkgs.Count
32
~\Downloads\Microsoft.WinGet.Client-PSModule
❯ $pkgs[0].AvailableVersions
ExtendedTypeSystemException: The following exception occurred while trying to enumerate the collection: "No such interface supported
".
~\Downloads\Microsoft.WinGet.Client-PSModule
❯ Get-Error
Exception :
Type : System.Management.Automation.ExtendedTypeSystemException
ErrorRecord :
Exception :
Type : System.Management.Automation.ParentContainsErrorRecordException
Message : The following exception occurred while trying to enumerate the collection: "No such interface supported
".
HResult : -2146233087
CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : ExceptionInGetEnumerator
InvocationInfo :
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : -1
Line : $pkgs[0].AvailableVersions
PositionMessage : At line:1 char:1
+ $pkgs[0].AvailableVersions
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
TargetSite :
Name : GetGenericEnumerator
DeclaringType : System.Management.Automation.EnumerableOps, System.Management.Automation, Version=7.2.8.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
MemberType : Method
Module : System.Management.Automation.dll
Message : The following exception occurred while trying to enumerate the collection: "No such interface supported
".
Data : System.Collections.ListDictionaryInternal
InnerException :
Type : System.InvalidCastException
TargetSite :
Name : As
DeclaringType : WinRT.IObjectReference
MemberType : Method
Module : WinRT.Runtime.dll
Message : No such interface supported
HResult : -2147467262
StackTrace :
at WinRT.IObjectReference.As[T](Guid iid)
at WinRT.IObjectReference.As[T]()
at System.Collections.Generic.IReadOnlyListImpl`1.Make_IEnumerableObjRef()
at System.Collections.Generic.IReadOnlyListImpl`1.GetEnumerator()
at System.Management.Automation.EnumerableOps.GetGenericEnumerator[T](IEnumerable`1 enumerable)
Source : System.Management.Automation
HResult : -2146233087
StackTrace :
at System.Management.Automation.EnumerableOps.GetGenericEnumerator[T](IEnumerable`1 enumerable)
at CallSite.Target(Closure , CallSite , Object , Pipe , ExecutionContext )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at System.Management.Automation.Interpreter.ActionCallInstruction`5.Invoke(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4)
at System.Management.Automation.Interpreter.CallInstruction.InvokeInstance(Object instance, Object[] args)
at System.Management.Automation.Interpreter.DynamicInstructionN.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
FullyQualifiedErrorId : ExceptionInGetEnumerator
InvocationInfo :
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : -1
Line : $pkgs[0].AvailableVersions
PositionMessage : At line:1 char:1
+ $pkgs[0].AvailableVersions
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
Brief description of your issue
One thing I noticed in the prerelease v1.4.3531 is that the
CatalogPackageobjects have anAvailableVersionsproperty that I can't seem to access in any way:The property
The error
Steps to reproduce
Install winget v1.4.3531 and then run this or equivalent:
Expected behavior
It should return the
System.Collections.Generic.IReadOnlyList[Microsoft.Management.Deployment.PackageVersionId]value of theAvailableVersionsproperty.Actual behavior
It throws an exception.
Environment