From 0f1f190258baa1edb0cf0154f285042d701d84e6 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Wed, 16 Jun 2021 20:09:49 -0400 Subject: [PATCH] PSSession --- disk_check.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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