From 9327ac246b3b93c061e032cff7bff3f71a4b58db Mon Sep 17 00:00:00 2001 From: Leonhard Seidel Date: Tue, 16 Dec 2025 17:10:48 +0100 Subject: [PATCH] Removed last Get-WmiObject, added quotes for local path to allow spaces in path --- backup.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backup.ps1 b/backup.ps1 index afac82b..02b4843 100755 --- a/backup.ps1 +++ b/backup.ps1 @@ -74,10 +74,10 @@ function Test-VSSSupport { Param($test_path) $drive_letter = Split-Path $test_path -Qualifier - $volume = Get-WmiObject -Query "SELECT * FROM Win32_Volume WHERE DriveLetter = '$drive_letter'" + $volume = Get-CimInstance -Query "SELECT * FROM Win32_Volume WHERE DriveLetter = '$drive_letter'" $deviceID = ($volume.DeviceID -replace '.*(\{.*\}).*', '$1') ### https://learn.microsoft.com/en-us/previous-versions/windows/desktop/vsswmi/win32-shadowvolumesupport - $supportedVolumes = Get-WmiObject -Query "SELECT * FROM Win32_ShadowVolumeSupport WHERE __PATH LIKE '%$deviceID%'" + $supportedVolumes = Get-CimInstance -Query "SELECT * FROM Win32_ShadowVolumeSupport WHERE __PATH LIKE '%$deviceID%'" return ($null -ne $supportedVolumes) } @@ -434,7 +434,7 @@ function Invoke-ConnectivityCheck { } # skip the internet connectivity check for local repos - if(Test-Path $env:RESTIC_REPOSITORY) { + if(Test-Path "$env:RESTIC_REPOSITORY") { "[[Internet]] Local repository. Skipping internet connectivity check." | Out-File -Append $SuccessLog return $true }