Is there a Windows equivalent to the touch command?
Asked
Active
Viewed 3,441 times
1 Answers
2
touch.ps1
Usage: touch [FILE]...
param(
[Parameter()]
[String]$file
)
if(Test-Path -Path $file){
(Get-Item -Path $file) | % {$_.LastWriteTime = (Get-Date)}
}
else{
(New-Item $file)
}
Add the directory to your touch.ps1 script to the PATH environment variable and you should be set.
Isaac
- 45