Skip to content

Instantly share code, notes, and snippets.

@Vaiz
Last active August 3, 2022 20:15
Show Gist options
  • Save Vaiz/548b8e27f745ef44883d5c8e8254134f to your computer and use it in GitHub Desktop.
Save Vaiz/548b8e27f745ef44883d5c8e8254134f to your computer and use it in GitHub Desktop.
PowerShell
#Get all file properties
PS E:\> Get-Item E:\dedupFile.bin | Format-list -Property *
#Get item attributes
PS E:\> [System.IO.File]::GetAttributes("<path>") -as [uint64]
PS E:\> (Get-ItemPropertyValue -Path <path> -Name Attributes) -as [uint64]
#change file date:
PS E:\> (Get-Item E:\dedupFile.bin).LastWriteTime = [datetime]::ParseExact("2019", "yyyy", $null)
PS E:\> (Get-Item E:\dedupFile.bin).LastWriteTime
Tuesday, January 1, 2019 12:00:00 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment