Skip to content

Instantly share code, notes, and snippets.

@atbradley
Created September 18, 2017 19:45
Show Gist options
  • Save atbradley/d76a7326bf5c5f77f8d2b8d3b28100b9 to your computer and use it in GitHub Desktop.
Save atbradley/d76a7326bf5c5f77f8d2b8d3b28100b9 to your computer and use it in GitHub Desktop.
Powershell equivalent of POSIX 'touch' command.
param([string] $fn)
if(!(New-Item $fn -ErrorAction SilentlyContinue)) {
Set-ItemProperty -Path $fn -Name LastWriteTime -Value (get-date)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment