Export (0) Print
Expand All
Expand Minimize

Converting the FileSystemObject's DateLastModified Property

Windows PowerShell

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


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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft