how to display additional info about files

to display standard information about a file
Get-ChildItem template.ps1

Directory: C:\myScripts

Mode LastWriteTime Length Name
—- ————- —— —-
-a— 9/13/2012 8:18 PM 242 template.ps1

To find out what properties are stored by .NET Framework
Get-ChildItem template.ps1 | Get-Member -MemberType Property

TypeName: System.IO.FileInfo

Name MemberType Definition
—- ———- ———-
Attributes Property System.IO.FileAttributes Attributes {get;set;}
CreationTime Property System.DateTime CreationTime {get;set;}
CreationTimeUtc Property System.DateTime CreationTimeUtc {get;set;}
Directory Property System.IO.DirectoryInfo Directory {get;}
DirectoryName Property System.String DirectoryName {get;}
Exists Property System.Boolean Exists {get;}
Extension Property System.String Extension {get;}
FullName Property System.String FullName {get;}
IsReadOnly Property System.Boolean IsReadOnly {get;set;}
LastAccessTime Property System.DateTime LastAccessTime {get;set;}
LastAccessTimeUtc Property System.DateTime LastAccessTimeUtc {get;set;}
LastWriteTime Property System.DateTime LastWriteTime {get;set;}
LastWriteTimeUtc Property System.DateTime LastWriteTimeUtc {get;set;}
Length Property System.Int64 Length {get;}
Name Property System.String Name {get;}

To display customized information:
Get-ChildItem template.ps1 | Select-Object name,extension,directory, exists

Name Extension Directory Exists
—- ——— ——— ——
template.ps1 .ps1 C:\myScripts True


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s