Ying Li at myITforum.com

PowerShell & System Center

Powershell script to change the Last Modified Timestamp for all the files in a folder

Here is a very cool script and you can change the last modified timestamp for all the files in a folder:

$Now= Get-Date
$TargetFolder = Get-ChildItem "C:\MyWorkPlace"
foreach($file in $Targetfolder)
{
$file.LastWriteTime = $Now
$Now = $now.Addminutes(5)
}
$TargetFolder

I can choose whatever the time I want and just change to $now = Get-Date "3/21/2007 2:00 PM ". This will make me looks busy in front of my boss if he cares. Or I could help some VIP users (of course, they need to buy me lunch first )

Posted: Mar 21 2007, 04:52 PM by yli628 | with no comments
Filed under:

Comments

No Comments