Created
June 5, 2014 21:00
-
-
Save forsythetony/6fa0a1ae84a4eec3ecc0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 definitions | |
# | |
function deleteAVIFilesInPath($path) | |
{ | |
if((Test-Path $path) -ne $true) | |
{ | |
$errMessage = "The path given was not valid" | |
return $errMessage | |
} | |
Write-Host "Things" | |
Write-Host ("The path is " + $path) | |
Get-ChildItem -Path $path -Recurse | Where-Object { $_.Extension -eq ".avi"} | ForEach-Object { | |
Write-Host ("Deleting file " + $_.Name) | |
Remove-Item $_.FullName | |
} | |
return $null | |
} | |
# | |
# Main program | |
# | |
$path = Read-Host "Enter the path to the folder containing subfolder 'kinectData'" | |
$confirmMessage = ("All .avi files in the folder " + $path + " will be deleted.") | |
Write-Host $confirmMessage | |
$userOption = Read-Host "Enter any key to continue or Ctrl-C to exit" | |
$ret = deleteAVIFilesInPath $path | |
if ($ret -ne $null) | |
{ | |
Write-Host $ret | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment