Skip to content

Commit e9e9bc6

Browse files
authored
Simplified LTF
1 parent 4c3575f commit e9e9bc6

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

RAM-Logger.ps1

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,7 @@ $Prelog = {
250250
Write-Host "`n"
251251
$startmsg = "$l14"
252252
Write-Host "$startmsg"
253-
if($tofile -eq 1){
254-
$startmsg | Out-File -Filepath $logpath -Append String
255-
}
253+
if($tofile -eq 1){$startmsg | Out-File -Filepath $logpath -Append String}
256254
$mainram = Get-CimInstance win32_operatingsystem -CimSession $session
257255
[decimal]$total = $mainram.TotalVisibleMemorySize/1024/1024
258256
$xtotal = $total | % {$_.ToString("0.000")}
@@ -279,9 +277,7 @@ $Startlog = {
279277
$xmaxusedp = $maxusedp | % {$_.ToString("000")}
280278
$log = "[$timestamp | $computerlog] Current: $xcrtuseds Gb / $xtotal Gb ($xcrtusedp%) | Min: $xminuseds Gb ($xminusedp%) | Max: $xmaxuseds Gb ($xmaxusedp%)"
281279
Write-Host "$log"
282-
if($tofile -eq 1){
283-
$log | Out-File -Filepath $logpath -Append String
284-
}
280+
if($tofile -eq 1){$log | Out-File -Filepath $logpath -Append String}
285281
$timeloop = $freq
286282
.$Loopmain
287283
}
@@ -297,14 +293,10 @@ $Loopmain = {
297293
$Stoplog = {
298294
$stopmsg = "$l15"
299295
Write-Host "$stopmsg"
300-
if($tofile -eq 1){
301-
$stopmsg | Out-File -Filepath $logpath -Append String
302-
}
303296
$lbreak = "`n"
304297
if($tofile -eq 1){
298+
$stopmsg | Out-File -Filepath $logpath -Append String
305299
$lbreak | Out-File -Filepath $logpath -Append String
306-
}
307-
if($tofile -eq 1){
308300
Write-Host "`n"
309301
Write-Host "$l16 $logpath"
310302
}

0 commit comments

Comments
 (0)