Created
May 20, 2019 05:30
-
-
Save sagunji/5d151f594ee6ccb3609a1f59974248aa to your computer and use it in GitHub Desktop.
A function which represents file creation in powershell
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
function touch-equi { | |
param( [string[]]$files) | |
Foreach ($file in $files) { | |
if (Test-Path -Path $file) { | |
Write-Host "$file already exists." | |
continue | |
} | |
New-Item -ItemType file $file | |
} | |
} | |
touch-equi a.txt,b.txt,x.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment