February 2019
Intermediate to advanced
626 pages
15h 51m
English
Depending on the type of object, properties may be read-only or read/write. These may be identified using Get-Member and by inspecting the access modifiers.
In the following example, the value in curly braces at the end of each line is the access modifier:
PS> $File = New-Item NewFile.txt -ForcePS> $File | Get-Member -MemberType Property TypeName: System.IO.FileInfoName MemberType Definition ---- ---------- ---------- Attributes Property System.IO.FileAttributes Attributes {get;set;}CreationTime Property datetime CreationTime {get;set;} CreationTimeUtc Property datetime CreationTimeUtc {get;set;} Directory Property System.IO.DirectoryInfo Directory {get;} DirectoryName Property string DirectoryName {get;} Exists Property ...Read now
Unlock full access