Get-ItemProperty
Read item properties
Get-ItemProperty -Path .\notes.txt
- Works on
- WindowsLinuxmacOS
- PowerShell
- 5.1 and later
- Reference
- Microsoft Learn: Get-ItemProperty
On the file system this looks a lot like Get-Item. On the registry it reads values under a key. Beginners mostly meet it in registry examples. Stay out of HKLM:\SAM and similar.
Try this
Get-ItemProperty -Path .\notes.txt | Select-Object Name, Length, LastWriteTime