Skip to content

Instantly share code, notes, and snippets.

@fslef
Created June 26, 2023 13:38
Show Gist options
  • Save fslef/79de4763e3d3e6e1b8ed1612ff056659 to your computer and use it in GitHub Desktop.
Save fslef/79de4763e3d3e6e1b8ed1612ff056659 to your computer and use it in GitHub Desktop.
New-File
function New-File {
param (
$Path
)
if (Get-Item $path -ErrorAction Ignore) {
Write-Verbose "File $path already exists."
}
else {
New-Item -Path $path -ItemType File | Out-Null
Write-Verbose "File $path created successfully."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment