Last active
July 5, 2020 07:03
-
-
Save tonytangau/94b989f72f93b1c5950eda7d7feccd01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add "touch" to powershell | |
# > code $profile | |
function touch { | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$Path | |
) | |
if (Test-Path -LiteralPath $Path) { | |
(Get-Item -Path $Path).LastWriteTime = Get-Date | |
} else { | |
New-Item -Type File -Path $Path | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment