Autoselect last midnight
This commit is contained in:
parent
187539c982
commit
62e6a1a260
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
# Get Hardware from VMS
|
# Get Hardware from VMS
|
||||||
$hardwarelist = Get-VmsCamera
|
$hardwarelist = Get-VmsCamera
|
||||||
$ext = ".jpg"
|
$ext = ".jpg"
|
||||||
|
$time = (Get-Date).AddDays(-1).ToString("dddd, MMMM dd, yyyy 01:00:00 A\M")
|
||||||
|
|
||||||
# Loop through the Cameralist
|
# Loop through the Cameralist
|
||||||
foreach ($camera in $hardwarelist) {
|
foreach ($camera in $hardwarelist) {
|
||||||
|
|
@ -18,7 +19,7 @@ foreach ($camera in $hardwarelist) {
|
||||||
}
|
}
|
||||||
# Match HardwareID and make snapshot
|
# Match HardwareID and make snapshot
|
||||||
try {
|
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
|
Write-Host "Saving as:" $file
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Failed to fetch snapshot for Camera ID:" $camera.HardwareId
|
Write-Host "Failed to fetch snapshot for Camera ID:" $camera.HardwareId
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue