Skip to content

Instantly share code, notes, and snippets.

@hickey
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hickey/b4a34dfe9b5f8759f2a8 to your computer and use it in GitHub Desktop.
Save hickey/b4a34dfe9b5f8759f2a8 to your computer and use it in GitHub Desktop.
$filepath = Read-Host "Please enter absolute path to file."
$filetest = Test-Path $filepath
if ("$filetest" -eq "True") {
Write-Host $filepath "present."
} else {
Write-Host $filepath "does not exist."
$Wish = Read-Host "Would you like to create this file - yes or no?"
if ("$Wish" -eq "yes") {
New-Item -ItemType file -Path $filepath -Force
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment