This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#require -Modules MilestonePSTools, MilestoneSystems.PowerShell.MediaDB | |
param( | |
# Specifies the path to a folder containing one or more XProtect media database folders. | |
[Parameter()] | |
[string] | |
$Source, | |
# Specifies the path to a folder where MKV files will be saved. | |
[Parameter()] | |
[string] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Modules Microsoft.PowerShell.ThreadJob | |
<# | |
This is an example of how you could parallelize exports. You _probably_ wouldn't do this specific thing in practice | |
but it was an easy proof of concept on a small system. | |
The following script will get all enabled cameras, and then get all recording sequences for todays date, and then | |
using the Start-ThreadJob command, it will run each export in a separate job, saving each recording sequence found | |
on each enabled camera to it's own MKV file in the C:\temp directory. | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-RandomPass { | |
<# | |
.Synopsis | |
Generates and returns a suitably secure password | |
.EXAMPLE | |
New-RandomPass | |
Returns a random password as a SecureString object | |
.EXAMPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ParsePng { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory, Position = 0)] | |
[string] | |
$Path | |
) | |
process { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-QueryString { | |
<# | |
.SYNOPSIS | |
Turn a hashtable into a URI querystring | |
.DESCRIPTION | |
Turn a hashtable into a URI querystring | |
.PARAMETER QueryParameter | |
The hashtable to transform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Send-VmsDriverCommand { | |
<# | |
.SYNOPSIS | |
Sends a custom HTTP request or command to a device added to an XProtect VMS. | |
.PARAMETER Camera | |
Specifies the camera to which the driver command should be sent. | |
.PARAMETER Fqid | |
Specifies the FQID associated with the destination device. Try `Get-VmsVideoOSItem` to retrieve an item, and then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Show-DateTimePicker { | |
[CmdletBinding()] | |
param( | |
[Parameter()] | |
[string] | |
$Title = 'Show-DateTimePicker', | |
[Parameter()] | |
[DateTimeKind] | |
$Kind = [DateTimeKind]::Local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertToGeoCoordinate ([string]$coordinate) { | |
Add-Type -AssemblyName System.Device | |
$lat, $lon = $Coordinate -split ',' | ForEach-Object { | |
[double]$_.Trim() | |
} | |
[device.location.geocoordinate]::new($lat, $lon) | |
} | |
function Measure-Distance { | |
[CmdletBinding()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MilestonePSTools.Connection; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Management.Automation; | |
using System.Management.Automation.Language; | |
using System.Text.RegularExpressions; | |
using VideoOS.ConfigurationApi.ClientService; | |
namespace MilestonePSTools.Utility |
NewerOlder