All pastes #502716 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-22 16:28 UTC
rendered paste body
Get-ChildItem -rec -exclude "*No-Number*" | % {
    	$objItem = $_

	Write-Host ('********' + $objItem.fullname )

	If ($objItem -is [System.IO.FileInfo] -and ((get-date) - [datetime]::Parseexact($objItem.name.split('-')[1],"yyyyMMdd",$null)).days -gt 360)
	{

	$oldpath = $objItem.FullName.SubString($pwd.path.length)
	$newpath = ('f:\old_calls\' + $oldpath)
	$olddir = ($objItem.directory -replace 'e:', 'f:\old_calls')

		if ([System.IO.Directory]::Exists($olddir) -eq $false)
		{
			New-Item $olddir -type directory 
		}
		Move-Item -path $objItem.fullname -destination $newpath
	}
	Else 
	{

		Write-host ('<<<<<>>>>>> the path above this line doesnt meet IF requirements')

	}
}