Skip to content

Instantly share code, notes, and snippets.

@Nora-Ballard
Created February 15, 2014 13:22
Show Gist options
  • Save Nora-Ballard/9019258 to your computer and use it in GitHub Desktop.
Save Nora-Ballard/9019258 to your computer and use it in GitHub Desktop.
Function Touch-File
{
param(
[Parameter(Mandatory=$True)]
$Path
)
if(Test-Path $Path)
{
Set-ItemProperty -Path $Path -Name LastWriteTime -Value $(get-date) -PassThru | Get-Item
}
else
{
New-Item -Path $Path -ItemType File
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment