19 lines
680 B
PowerShell
19 lines
680 B
PowerShell
# datastore
|
|
$AllDatastores = Get-Datastore -Name *FS92* | sort-object Name
|
|
|
|
$AllFiles = @()
|
|
ForEach ($Datastore in $AllDatastores) {
|
|
write-warning $Datastore.name
|
|
Set-Location $Datastore.DatastoreBrowserPath
|
|
|
|
$expiredFolders = Get-ChildItem | `
|
|
Where-Object { $_.Name -notlike "*.sf" -and $_.Name -notlike ".vSphere*" -and $_.Name -notlike ".dvs*" -and $_.Name -notlike ".naa*" -and $_.Name -ne 'vmkdump' -and $_.Name -ne 'syslog'} | `
|
|
Where-Object LastWriteTime -LT ((Get-Date).AddDays(-30))
|
|
|
|
|
|
ForEach ($folder in $expiredFolders) {
|
|
write-warning $folder.name
|
|
$AllFiles += Get-ChildItem -Path $Folder.FullName -Recurse
|
|
|
|
}
|
|
} |