Search notes:

PowerShell cmdLet Get-Item

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
These attributes correspond to a subset of the attributes listed in the System.IO.FileAttributes enumeration.

Returned types

The .NET type that is returned by get-item depends on the thing that get-item gets.
Item Class
File system directory System.IO.DirectoryInfo
File System file TODO
Registry key Microsoft.Win32.RegistryKey
TODO

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

See also

get-childItem
The method GetItem() in System.Management.Automation.Provider.ItemCmdletProvider.
The command parameter -credential.
Powershell command noun: item

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1743601829, '18.191.44.70', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/command-inventory/noun/item/get/index(100): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78