diff --git a/VMSSnapshooter.ps1 b/VMSSnapshooter.ps1 index ee9e10a..88d3f73 100644 --- a/VMSSnapshooter.ps1 +++ b/VMSSnapshooter.ps1 @@ -1,6 +1,7 @@ # Get Hardware from VMS $hardwarelist = Get-VmsCamera $ext = ".jpg" +$time = (Get-Date).AddDays(-1).ToString("dddd, MMMM dd, yyyy 01:00:00 A\M") # Loop through the Cameralist foreach ($camera in $hardwarelist) { @@ -18,7 +19,7 @@ foreach ($camera in $hardwarelist) { } # Match HardwareID and make snapshot try { - $null = Get-Snapshot -CameraId $camera.Id -Timestamp "Thursday, June 27, 2024 01:00:00 AM" -Save -Path $path -Quality 100 -FileName $file + $null = Get-Snapshot -CameraId $camera.Id -Timestamp $time -Save -Path $path -Quality 100 -FileName $file Write-Host "Saving as:" $file } catch { Write-Host "Failed to fetch snapshot for Camera ID:" $camera.HardwareId