Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been searching far and wide for explicit information on this, but I have not found any at all. Let's say I have a a file or a directory stored in the variable $Item. Using Windows PowerShell (I am using 3.0), how can I get all of the metadata associated with $Item that is not stored in its contents? For instance, I want to get it's permissions, its SID, its time of creation, its time of modification, the time it was last accessed, its attributes, and pretty much anything else that is displayed in the 'Properties' dialog box in Windows Explorer. I need to do this so I can record each item's properties in SVN metadata.

share|improve this question


$item = Get-Item c:\windows\notepad.exe

Last access time:


Last modification time:


Creation time:




Version info:


The security permissions are not stored in the file, so you have to use the Get-Acl cmdlet:

(Get-Acl $item).Access
share|improve this answer

you can get most of those elements from the System.IO.DirectoryInfo class

PS C:\Windows\system32> $([System.IO.DirectoryInfo]"c:\").creationtime
PS C:\Windows\system32> $([System.IO.DirectoryInfo]"c:\").Attributes


Here are the properties available from the object:

now, I'm not sure what you mean by recursive, since you said you didn't want the contents of the directory, but you can get a list of sub items using .GetFiles or .GetDirectories. then you can recurse or iterate over them as you like.

share|improve this answer
I use the word "recursively" because I need it to cycle through them automatically. – Melab Mar 13 '13 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .