TechNet
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting the FileSystemObject's DateLastModified Property


Windows PowerShell


Definition: Returns the date and time the file was last modified.

DateLastModified


To retrieve the last-modified date and time in PowerShell, you first need to retrieve a reference to the file by passing the name of the file to the Get-Item cmdlet. Then you can retrieve the last-modified date and time from the LastWriteTime property:


(Get-Item c:\scripts\test.txt).LastWriteTime


See conversions of other FileSystemObject methods and properties.
Return to the VBScript to Windows PowerShell home page

Show:
© 2016 Microsoft