Powershell: format-default: Target type System.Collections.IEnumerator is not a value type or a non-abstract class. (Parameter 'targetType')

Created on 7 Apr 2020  Â·  2Comments  Â·  Source: PowerShell/PowerShell

Steps to reproduce

C:\Users\Robert Holt\Documents\Dev\Microsoft\PSArm\RobImpl [master ≡ +1 ~0 -0 !]
> iwr 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' -OutFile mainschema.json
C:\Users\Robert Holt\Documents\Dev\Microsoft\PSArm\RobImpl [master ≡ +1 ~0 -0 !]
> [Newtonsoft.Json.Linq.JToken]::Parse((Get-Content -Raw .\mainschema.json)) | sv jt
C:\Users\Robert Holt\Documents\Dev\Microsoft\PSArm\RobImpl [master ≡ +1 ~0 -0 !]
> $jt

HasValues    : False
Type         : String
Parent       : {}
Root         : {id, $schema, title, description…}
Next         :
Previous     :
Path         : id
First        :
Last         :
LineNumber   : 1
LinePosition : 87

HasValues    : False
Type         : String
Parent       : {}
Root         : {id, $schema, title, description…}
Next         :
Previous     :
Path         : $schema
First        :
Last         :
LineNumber   : 1
LinePosition : 139

HasValues    : False
Type         : String
Parent       : {}
Root         : {id, $schema, title, description…}
Next         :
Previous     :
Path         : title
First        :
Last         :
LineNumber   : 1
LinePosition : 158

HasValues    : False
Type         : String
Parent       : {}
Root         : {id, $schema, title, description…}
Next         :
Previous     :
Path         : description
First        :
Last         :
LineNumber   : 1
LinePosition : 203

HasValues    : False
Type         : String
Parent       : {}
Root         : {id, $schema, title, description…}
Next         :
Previous     :
Path         : type
First        :
Last         :
LineNumber   : 1
LinePosition : 219

Type                       :
HasValues                  :
First                      :
Last                       :
Count                      :
Parent                     :
Root                       :
Next                       :
Previous                   :
Path                       :
LineNumber                 :
LinePosition               :
IsReadOnly                 :
AllowNew                   :
AllowEdit                  :
AllowRemove                :
SupportsChangeNotification :
SupportsSearching          :
SupportsSorting            :
IsSorted                   :
SortProperty               :
SortDirection              :
IsFixedSize                :
SyncRoot                   :
IsSynchronized             :
Keys                       :

HasValues    : False
Type         : Boolean
Parent       : {}
Root         : {id, $schema, title, description…}
Next         :
Previous     :
Path         : additionalProperties
First        :
Last         :
LineNumber   : 1
LinePosition : 164126

format-default: Target type System.Collections.IEnumerator is not a value type or a non-abstract class. (Parameter 'targetType')

Expected behavior

Full object formats as list

Actual behavior

Formatter throws an exception

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.0-preview.1
PSEdition                      Core
GitCommitId                    7.1.0-preview.1
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Question Resolution-Duplicate WG-Engine

Most helpful comment

Duplicate of #10650 I think

All 2 comments

Duplicate of #10650 I think

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Was this page helpful?
0 / 5 - 0 ratings