我有一个带有while循环的powershell脚本,当它首先使用15,504kb内存启动脚本时,但看起来每次它通过while循环时内存使用量增加约100kb,它似乎永远不会下楼。
$exe = 'C:\Program Files (x86)\MyApp\MyApp.exe'
$logOutput = 'C:\Log\Log.log'
$logdir1 = 'C:\Log'
$storage = 'ext'
$date = (Get-Date)
"{0:dd/MM/yy HH:mm:ss} - START" -f $date | Out-File -filepath $logOutput -NoClobber -Append -Encoding ASCII
While ($true){
$date = (Get-Date)
"{0:dd/MM/yy HH:mm:ss} - Calling exe for D:\" -f $date | Out-File -filepath $logOutput -NoClobber -Append -Encoding ASCII
& $exe /logdir $logdir1 /storage $storage
Start-Sleep -s 5
$date = (Get-Date)
"{0:dd/MM/yy HH:mm:ss} - Calling exe for E:\" -f $date | Out-File -filepath $logOutput -NoClobber -Append -Encoding ASCII
& $exe /logdir $logdir1 /storage $storage
Start-Sleep -s 10
}
我的剧本有问题吗?