PowerShell: File Attributes Object Type

By Xah Lee. Date: . Last updated: .

Object type of file Attribute

File attribute is of the dotnet type System.IO.FileAttributes

# list properties of a file
Get-ItemProperty ~\Documents\ | Get-Member -MemberType Properties

#    TypeName: System.IO.DirectoryInfo

# Name                MemberType     Definition
# ----                ----------     ----------
# Target              AliasProperty  Target = LinkTarget
# LinkType            CodeProperty   System.String LinkType{get=GetLinkType;}
# Mode                CodeProperty   System.String Mode{get=Mode;}
# ModeWithoutHardLink CodeProperty   System.String ModeWithoutHardLink{get=ModeWithoutHardLink;}
# ResolvedTarget      CodeProperty   System.String ResolvedTarget{get=ResolvedTarget;}
# PSChildName         NoteProperty   string PSChildName=Documents
# PSDrive             NoteProperty   PSDriveInfo PSDrive=C
# PSParentPath        NoteProperty   string PSParentPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\xah
# PSPath              NoteProperty   string PSPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\xah\Documents\
# PSProvider          NoteProperty   ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem
# Attributes          Property       System.IO.FileAttributes Attributes {get;set;}
# CreationTime        Property       datetime CreationTime {get;set;}
# CreationTimeUtc     Property       datetime CreationTimeUtc {get;set;}
# Exists              Property       bool Exists {get;}
# Extension           Property       string Extension {get;}
# FullName            Property       string FullName {get;}
# LastAccessTime      Property       datetime LastAccessTime {get;set;}
# LastAccessTimeUtc   Property       datetime LastAccessTimeUtc {get;set;}
# LastWriteTime       Property       datetime LastWriteTime {get;set;}
# LastWriteTimeUtc    Property       datetime LastWriteTimeUtc {get;set;}
# LinkTarget          Property       string LinkTarget {get;}
# Name                Property       string Name {get;}
# Parent              Property       System.IO.DirectoryInfo Parent {get;}
# Root                Property       System.IO.DirectoryInfo Root {get;}
# UnixFileMode        Property       System.IO.UnixFileMode UnixFileMode {get;set;}
# BaseName            ScriptProperty System.Object BaseName {get=$this.Name;}

PowerShell. File Properties, Attributes, Permission