You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type data for System.Array type contains single alias property Count -> Length. It was good for consistency, as ICollection.Count is implemented explicitly by arrays and was not visible while other collections types do not have Length property. But since PowerShell v3 it is possible to reference explicitly implemented interface members. So, this alias property no longer necessary. It also cause some headaches with ConvertTo-Json cmdlet:
It feels reasonable to remove the AliasProperty Count from System.Array, given that powershell now exposes the Count property implementation from ICollection interface. Feel free to submit a PR, the AliasProperty is defined here.
As for ConvertTo-Json, the issue you listed seems to have been fixed in powershell core:
Dongbo Wang (@daxian-dbw) Is it OK to edit Types_Ps1Xml.generated.cs directly? I mean it have generated in name and this header:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
It looks like it was automatically generated from Types.ps1xml file, but I can not find this file in repository.
Activity
daxian-dbw commentedon Feb 28, 2017
It feels reasonable to remove the AliasProperty
CountfromSystem.Array, given that powershell now exposes theCountproperty implementation fromICollectioninterface. Feel free to submit a PR, the AliasProperty is defined here.As forConvertTo-Json, the issue you listed seems to have been fixed in powershell core:iSazonov commentedon Feb 28, 2017
Dongbo Wang (@daxian-dbw) What build do you use? I see the issue in alfa.16 (Windows 10 14936):
PetSerAl commentedon Feb 28, 2017
Dongbo Wang (@daxian-dbw) Is it OK to edit
Types_Ps1Xml.generated.csdirectly? I mean it havegeneratedin name and this header:It looks like it was automatically generated from
Types.ps1xmlfile, but I can not find this file in repository.iSazonov commentedon Feb 28, 2017
PetSerAl Now
Types.ps1xmlis in code for faster Powershell start. You can modifyTypes_Ps1Xml.generated.cs(see the file history on GitHub).lzybkr commentedon Feb 28, 2017
The file was generated to keep the ps1xml in sync, but we no longer maintain the ps1xml, so we should remove the comment and rename the file.
daxian-dbw commentedon Feb 28, 2017
Ilya (@iSazonov) My bad, I must have tried that after
Remove-TypeData. Removing the alias propertyCountwill fix that.iSazonov commentedon Feb 28, 2017
Dongbo Wang (@daxian-dbw) Clear.
Jason Shirk (@lzybkr) I searched
*generated.*- there are multiple files. Are there files that we also should fix?lzybkr commentedon Feb 28, 2017
For now, I would just change:
The files in GraphicalHost can be ignored, and the ones in the interpreter come from another project, so it would be better to not rename those.
iSazonov commentedon Feb 28, 2017
I opened Issue #3230