This file contains hidden or 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 Get-VmsDeviceStatus { | |
| [CmdletBinding(DefaultParameterSetName = 'All')] | |
| param( | |
| [Parameter(Mandatory, ValueFromPipeline, ParameterSetName = 'All')] | |
| [Parameter(Mandatory, ValueFromPipeline, ParameterSetName = 'SpecifiedDevices')] | |
| [VideoOS.Platform.ConfigurationItems.RecordingServer] | |
| $RecordingServer, | |
| [Parameter(Mandatory, ParameterSetName = 'All')] | |
| [ValidateSet('Camera', 'Microphone', 'Speaker', 'Metadata', 'InputEvent', 'Output', 'Hardware')] |
This file contains hidden or 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
| # Make sure we have permission to execute ps1 files within the scope of this running process only | |
| Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force -Confirm:$false | |
| if ($null -eq (Get-Module -ListAvailable -Name MilestonePSTools)) { | |
| # MilestonePSTools is not installed so let's take care of some prerequisits for using Install-Module to install it | |
| [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 | |
| $nugetProvider = Get-PackageProvider -ListAvailable -Name NuGet -ErrorAction Ignore | |
| if ($null -eq $nugetProvider -or $nugetProvider.Version -lt [version]'2.8.5.201') { | |
| Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | |
| } |
This file contains hidden or 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 ConvertFrom-Snapshot { | |
| <# | |
| .SYNOPSIS | |
| Converts from the output provided by Get-Snapshot to a [System.Drawing.Image] object. | |
| .DESCRIPTION | |
| Converts from the output provided by Get-Snapshot to a [System.Drawing.Image] object. Don't | |
| forget to call Dispose() on Image when you're done with it! | |
| .EXAMPLE | |
| PS C:\> $image = $camera | Get-Snapshot -Live | ConvertFrom-Snapshot | |
| Get's a live snapshot from $camera and converts it to a System.Drawing.Image object and saves it to $image |
This file contains hidden or 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-Camera { | |
| [CmdletBinding()] | |
| param ( | |
| # Specifies the Id of the camera you wish to view. Omit this parameter and you can select a camera from an item selection dialog. | |
| [Parameter(ValueFromPipelineByPropertyName)] | |
| [guid[]] | |
| $Id, | |
| # Specifies the diagnostic overview level to show overlayed onto the image | |
| [Parameter()] |
This file contains hidden or 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 Find-ArchiveGaps { | |
| [CmdletBinding()] | |
| param ( | |
| # Specifies the path to the archives_cache file to analyze | |
| [Parameter()] | |
| [string] | |
| $Path = ".\archives_cache.xml" | |
| ) | |
| process { |
This file contains hidden or 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 Get-PtzAbsolutePosition { | |
| [CmdletBinding()] | |
| [OutputType([VideoOS.Platform.Messaging.PTZGetAbsoluteRequestData])] | |
| param( | |
| # Specifies the FQID of the PTZ camera. Tip: If you have a "Camera" object, you need a "CameraItem" object instead. Use Get-PlatformItem to get the *Item object for the associated camera. The FQID property can be found attached to this. | |
| [Parameter(Mandatory, ValueFromPipelineByPropertyName)] | |
| [VideoOS.Platform.FQID]$Fqid | |
| ) | |
| process { |
This file contains hidden or 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 Get-RoleReport { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter()] | |
| [switch] | |
| $IncludeNoAccess | |
| ) | |
| process { | |
| $cameras = Get-VmsCamera |
This file contains hidden or 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
| # Prompts you to choose a Recording Server to apply the template to | |
| $recordingServer = Get-RecordingServer | Out-GridView -OutputMode Single | |
| if ($null -eq $recordingServer) { | |
| throw 'No Recording Server was selected' | |
| } | |
| # The template definition | |
| $storageTemplate = @{ | |
| Live = @{ | |
| Name = 'Primary' |
This file contains hidden or 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 -RunAsAdministrator | |
| #Requires -Modules IISAdministration, MilestonePSTools | |
| function Get-VmsIISSite { | |
| [CmdletBinding()] | |
| [OutputType([Microsoft.Web.Administration.Site])] | |
| param() | |
| process { | |
| $site = Get-IISSite | Where-Object { $_.Applications | Where-Object ApplicationPoolName -like VideoOS* } |
This file contains hidden or 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
| <# | |
| .SYNOPSIS | |
| Request and install a publicly signed certificate from Let's Encrypt for your Milestone XProtect Mobile Server. | |
| .DESCRIPTION | |
| This script is an all(most)-in-one tool to register a publicly signed certificate from Let's Encrypt | |
| based on a DDNS domain name registered at Dynu.com. Before you run this script, please visit | |
| Dynu.com, register, add a DDNS domain name to your account, and visit your Dynu.com control panel | |
| to generate and take note of your OAuth2 ClientID and Secret. |