Skip to content

Instantly share code, notes, and snippets.

@PCfromDCSnippets
Last active January 5, 2016 18:15
Show Gist options
  • Save PCfromDCSnippets/e97aa014e57206f8c4b4 to your computer and use it in GitHub Desktop.
Save PCfromDCSnippets/e97aa014e57206f8c4b4 to your computer and use it in GitHub Desktop.
Wait 10 Seconds and Delete Old File
#region wait for 10 then Delete Old Files
# wait for 10
for ($i = 10; $i -gt 0; $i--) {
Write-Host("Deleting old files in $i seconds")
Start-Sleep -Seconds 1
}
# delete old files
foreach ($item in $items) {
Remove-Item -Path $item.CurrentLocation -Force
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment