Skip to content

Instantly share code, notes, and snippets.

@robie2011
Created July 17, 2014 07:26
Show Gist options
  • Save robie2011/719507778e703f4e4b16 to your computer and use it in GitHub Desktop.
Save robie2011/719507778e703f4e4b16 to your computer and use it in GitHub Desktop.
Powershell Ordner rekursiv nach Backupdatei scannen und darstellen
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