Search notes:

System.DateTime: file time related methods

System.DateTime offers four file time related methods:

Get the creation file time of a file

The following simple PowerShell script prints the creation time of itself represented as file time value:
$thisScript = $myInvocation.myCommand.path

#
# get-item returns a System.IO.FileInfo
#
$fileInfo = get-item $thisScript

#
#  CreationTimeUtc evaluates to a System.DateTime
#
$creationTimeUTC = $fileInfo.CreationTimeUtc

$creationTimeUTC.ToFileTimeUtc()
Github repository .NET-API, path: /System/DateTime/_Filetime/get-filetime-of-file.ps1

Index