Created
June 21, 2018 18:36
-
-
Save scotgabriel/d382b105ca27c2f1ab546c1a182e7a82 to your computer and use it in GitHub Desktop.
Powershell check files in folder for "last modified" value 1 day or less
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
$folderToCheck = "E:\data\backups" | |
if ((Get-ChildItem -Path $folderToCheck | ? {$_.LastWriteTime -gt (Get-Date).AddDays(-1)}.Count -lt 1) { | |
write-host "Bad Juju" | |
} else {write-host "G2g"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment