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 } }