diff --git a/disk_check.ps1 b/disk_check.ps1 index 81df99d..b7f3e80 100644 --- a/disk_check.ps1 +++ b/disk_check.ps1 @@ -8,7 +8,7 @@ $logFile="C:\ACS\disk_check.log" $computerName='localhost' -$cimSession=New-Session $computerName +$cimSession=New-PSSession $computerName $rebootTime=Get-Date "1:00" $requireReboot=$false $volumes=Get-Volumes -CimSession $cimSession @@ -20,7 +20,7 @@ Function Write-Log{ } foreach ($i in $volumes) { - $result=Repair-Volumes -CimSession $cimSession -FileSystemLabel $v.FileSystemLabel -Scan + $result=Repair-Volume -CimSession $cimSession -FileSystemLabel $v.FileSystemLabel -Scan if ($result.value -gt 0) { Repair-Volume -CimSession $cimSession -FileSystemLabel $v.FileSystemLabel -Scan -OfflineScanAndFix