Created
July 17, 2014 07:26
-
-
Save robie2011/719507778e703f4e4b16 to your computer and use it in GitHub Desktop.
Powershell Ordner rekursiv nach Backupdatei scannen und darstellen
This file contains 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
gci C:\backup\folder | %{ | |
# Root Kundenordner | |
gci $_.fullname| %{ | |
#Client folder | |
gci $_.fullname | %{ | |
#$_.fullname | |
# Client/Application/Subfolder | |
if( $_.name.tolower().contains("sicherung")){ | |
gci ("{0}\{1}" -f $_.fullname,"server") | ?{ $_.Extension -eq ".zip" -and $_.lastwritetime -gt (get-date).addDays(-1) } | | |
select fullname,lastwritetime, @{label="size in megabytes";Expression={"{0:N2} MB" -f ($_.Length / 1MB)}} | | |
format-list | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment