Created
January 30, 2014 08:50
-
-
Save r-plus/8704808 to your computer and use it in GitHub Desktop.
create files for mtime execution handling test on windows.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make many directories | |
cd ~\test | |
for ($i=0; $i -lt 100; $i++) { | |
New-Item $i\00 -type directory | Out-Null | |
New-Item $i\99 -type directory | Out-Null | |
} | |
# create files and tweak modify-date if file number is even. | |
function CreateNewFiles($path) | |
{ | |
cd $path | |
for ($i=0; $i -lt 10; $i++) { | |
New-Item $i -type file | Out-Null | |
$even = $i%2 | |
if ($even -eq 0) { | |
Set-ItemProperty $i -name LastWriteTime -value "2000/01/01 00:00:00" | Out-Null | |
} | |
} | |
} | |
$dirs=`ls` | |
foreach ($d in $dirs) { | |
CreateNewFiles("~\test\$d\00") | |
CreateNewFiles("~\test\$d\99") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment