From 146e729b7af5a0653ffe9f8fb0b0f0604e8c50cc Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 16 Jun 2021 20:46:52 -0400 Subject: [PATCH] fixes --- disk_check.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disk_check.ps1 b/disk_check.ps1 index e064e7c..6e075c7 100644 --- a/disk_check.ps1 +++ b/disk_check.ps1 @@ -16,7 +16,7 @@ Function Write-Log{ Param ([string]$logstring) if (-not(Test-Path -Path $logFile -PathType Leaf)) { - Add-Item -ItemType File -Path $logFile -Force + New-Item -ItemType File -Path $logFile -Force } Add-Content $logFile -value $logstring @@ -29,7 +29,7 @@ foreach ($i in $volumes) { Repair-Volume -FileSystemLabel $i.FileSystemLabel -Scan -OfflineScanAndFix $requireReboot = $true } else { - Write-Output "$(i.FileSystemLabel): Drive is OK!" + Write-Output $i.FileSystemLabel + ": Drive is OK!" Write-Log $now + ',' + $i.FileSystemLabel + ',' + $result + ',' + $targetComputer } }