Last active
August 3, 2022 20:20
-
-
Save breezhang/4641849 to your computer and use it in GitHub Desktop.
Powershell Generic Collections powershell v3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-Object System.Collections.ObjectModel.Collection["string"] | |
# from msdn | |
#[SerializableAttribute] | |
#[ComVisibleAttribute(false)] | |
#public class Collection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable | |
# | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$o=1|Select Nom, DureeDeVie,Numero | |
$DefaultProperties =@('Nom','DureeDeVie') | |
$DefaultPropertySet=New System.Management.Automation.PSPropertySet('DefaultDisplayPropertySet',[string[]]$DefaultProperties) | |
$PSStandardMembers=[System.Management.Automation.PSMemberInfo[]]@($DefaultPropertySet) | |
$o|Add-Member MemberSet PSStandardMembers $PSStandardMembers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment