Mode
Among others get-item
prints a Mode
column:
PS C:\Users\Rene> get-item foo.txt
…
Mode LastWriteTime Length Name
---- ------------- ------ ----
-ar--- 23.11.2021 21:32 11669 foo.txt
The value of mode
consists of up to six characters or dashes. A dash indicates that the corresponding item does not have an attribute while the character indicates the presence of the attribute.
The characters have following meaning, from left to right:
d | Directory |
a | Archive |
r | Read-only |
h | Hidden |
s | System |
l | Reparse Point |
Getting an item's parent item
If the item is a directory:
(get-item $env:temp).parent
(get-item $env:temp).parent.fullName
If the item is a file:
(get-item $profile).directory
(get-item $profile).directory.fullkame