Linha de comando:
ps-run.cmd listf15.ps1
primeira execução ~ 33 GB / min (~ 30 min - 1Tb)
última execução ~ 125-250 GB / min (~ 8-4 min - 1Tb)
é lento ...
ps-run.cmd:
@IF "%time:~0,1%" GTR "0" SET current=%DATE:~-4%-%DATE:~3,2%-%DATE:~0,2%@%TIME:~0,2%.%TIME:~3,2%.%TIME:~6,2%
@IF "%time:~0,1%" LSS "0" SET current=%DATE:~-4%-%DATE:~3,2%-%DATE:~0,2%@0%TIME:~1,1%.%TIME:~3,2%.%TIME:~6,2%
@echo %current%
powershell .\%* 9>&1 8>&1 7>&1 6>&1 5>&1 4>&1 3>&1 2>&1 0>&1 >> .\err%current%.txt
::STDIN 0 Keyboard Input
::STDOUT 1 Output in the Command Prompt window
::STDERR 2 Output error in the command prompt window
::UNDEFINED 3-9
listf15.ps1:
$RunTime = [System.Diagnostics.Stopwatch]::StartNew()
$CurentTime=$(get-date)
echo "Run @ $CurentTime"
[string]$ReportLine = [char]183
$ReportLine = [string]$ReportLine * 80
$cd = [environment]::CurrentDirectory
$logfile=$cd+'\SystemDrive.txt'
$HH=10
[DateTime]$TM=(get-date).AddHours(-$HH)
ac -Path $logfile -Va $ReportLine
ac -Path $logfile -Va "Last Write Time $HH hours"
ac -Path $logfile -Va $TM" - "$CurentTime
ac -Path $logfile -Va $ReportLine
$Files = ls ${Env:SystemDrive} -recurse -force -filter "*" | ?{!$_.PSIsContainer -and ($_.LastWriteTime -GT [DateTime]$TM)}
$i =0
Foreach ($file in $Files) {
'"{0:yyyy-MM-dd HH:mm:ss}";"{1}";"{2}"' -f $file.LastWriteTime, $file.Length, $file.FullName | '
Out-File -encoding "Default" -append $logfile -width 400 -OutBuffer 2147483647 -EA 0
$i++
}
write-host "Count : $i"
$CurentTime=$(get-date)
ac -Path $logfile -Va $ReportLine
ac -Path $logfile -Va "Count : $i"
write-host "End @ $CurentTime"
write-host "Total Run : $($RunTime.Elapsed.ToString())"
ac -Path $logfile -Va $CurentTime
ac -Path $logfile -Va "Total Run : $($RunTime.Elapsed.ToString())"
ac -Path $logfile -Va $ReportLine
Saída, SystemDrive.txt:
················································································
Last Write Time 10 hours
06/20/2013 16:48:04 - 06/21/2013 02:48:04
················································································
"2013-06-20 17:45:47";"0";"C:\Users\Administrator\Application Data\Macromedia\Flash Player\Logs\flashlog.txt"
"2013-06-20 19:41:57";"602";"C:\Users\Administrator\Application Data\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\settings.sol"
"2013-06-20 19:41:57";"81";"C:\Users\Administrator\Application Data\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\#s.ytimg.com\settings.sol"
"2013-06-21 00:45:35";"372637";"C:\Users\Administrator\Application Data\Microsoft\CryptnetUrlCache\Content8C4A5B5879D48381195FA49E2E6532"
"2013-06-20 18:10:34";"31235";"C:\Users\Administrator\Application Data\Microsoft\CryptnetUrlCache\ContentA1C9C30288A186F932D2F6CE954534"
... etc ....
················································································
Count : 4333
21.06.2013 2:57:42
Total Run : 00:03:55.8185680
················································································
Saída, [email protected]:
Run @ 06/21/2013 02:48:04
Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
At D:\VBS\PS-03FileList\listf15.ps1:20 char:12
+ $Files = ls <<<< ${Env:SystemDrive} -recurse -force -filter "*.*" | ?{!$_.PSIsContainer -and ($_.LastWriteTime -GT [DateTime]$TM)}
+ CategoryInfo : ReadError: (C:\Not! David Blaine! раскукож меня обратно! ... VJCP 68096 97):String) [Get-ChildItem], PathTooLongException
+ FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand
%windir%\system32\WindowsPowerShell\v1.0\
powershell.exe.config, powershell_ise.exe.config:
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v4.0.30319"/>
</startup>
</configuration>
sem erro:
Linha de comando, o Powershell 64-bit não usa o .NET 4.0 permanentemente e não usa multithreading:
reg add hklm\software\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 0 /f
Linha de comando, o Powershell 32-bit não usa o .NET 4.0 permanentemente e não usa multithreading:
reg add hklm\software\wow6432node\microsoft\.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 0 /f