sync
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
$ImportCsv = Import-Csv -Path 'D:\OneDrive - State of North Dakota\CleanupFileLocations.csv'
|
||||
|
||||
$FilesToDelete=@()
|
||||
ForEach($Directory in $ImportCsv) {
|
||||
$GetChildItemParams = @{
|
||||
Path = $Directory.Path
|
||||
}
|
||||
If($Directory.Filter){$GetChildItemParams += @{Filter = $Directory.Filter}}
|
||||
If($Directory.Recursive -eq $true){$GetChildItemParams += @{Recurse = $true}}
|
||||
$Files = Get-ChildItem @GetChildItemParams | Where-Object LastWriteTime -lt (Get-Date).AddDays(-$Directory.DaysToKeep)
|
||||
}
|
||||
Reference in New Issue
Block a user