There are multiple ways to install MilestonePSTools. The quickest method is to copy & paste the following line into a Windows PowerShell prompt on the computer where you want to use it.
MilestonePSTools does not need to be installed on the Milestone XProtect Management Server. Nearly every command in the module is designed to connect to your VMS the same way XProtect Smart Client and Management Client do.
- Supports all Milestone XProtect Advanced VMS editions, including XProtect Essential+.
- Some features in MilestonePSTools rely on specific VMS editions. For example, creating evidence locks requires that you run XProtect Corporate.
- Requires XProtect Management Server version 2014 or greater.
- Some functionality in MilestonePSTools will require newer software versions.
- Supports Windows PowerShell 5.1 (Desktop edition) with .NET Framework 4.7 or later
- To check your PowerShell version, open PowerShell and type
$PSVersionTable. The PSVersion value is your PowerShell version.
- If you have an earlier version of PowerShell, you may need to install Windows Management Framework 5.1.
- If you have a newer version of PowerShell, that's okay! PowerShell 5.1 can operate side by side with newer versions of PowerShell.
Install for all users
This script will prepare your PowerShell environment by updating certain components used to support installation of modules from Microsoft's PowerShell Gallery. It will then install the module for all users on the local system. This is the same script used by the one-line command at the top of this page.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Installing a PowerShell module for all users requires Administrative privileges. Once installed, it is generally recommended to use a non-privileged PowerShell terminal unless the task you're performing requires elevation.
Install for the current user
This script is similar to the all-users script, except it installs and updates components without requiring administrative privileges. This means that unless security policies prevent normal users from changing the execution policy in your environment, you can probably install MilestonePSTools without needing to "run as administrator". It also means the MilestonePSTools commands will only be available to your user account.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
If your Milestone VMS is "air-gapped" or for any other reason you're unable to
install a PowerShell module using the
Install-Module cmdlet which downloads
it directly from PowerShell Gallery, you can still install MilestonePSTools.
Step 1: Download the Nupkg files
What on earth is a nupkg file? For starters, you can pronounce it as "Nup-keg" which is fun! And it stands for "NuGet Package". Oh, and NuGet is the name of Microsoft's package manager introduced primarily for managing .NET application packages. In this case, "package" means one or more DLL files and some basic instructions for where they go. Back before ~2010, most .NET developers were manually copying around DLL files and adding references to them when needed. It made it very complicated to share reusable libraries. Now, with NuGet.org, you can reference a package by name, and automatically download/unpack/use that package.
To manually download MilestonePSTools, you'll need to download two files. The first is the MilestonePSTools "raw nupkg file", and the second is the MipSdkRedist nupkg. The MipSdkRedist module is the container used for the Milestone MIP SDK on which MilestonePSTools is based. Here are the links to the two PowerShell modules on PSGallery. Once there, click Manual Download under Installation Options and then click Download the raw nupkg file.
Step 2: Extract the contents
These nupkg files are actually ZIP files! If you add the
.zip extension to
the file, you can view/extract the contents like any other zip file. Here's
what the contents look like for MilestonePSTools...
Before you extract the ZIP files, make sure to right-click on both files and open Properties. If you see a checkbox to "unblock" the files, you should do this before extracting them. Otherwise each individual extracted file will also be blocked.
Step 3: Copy to the destination
After you extract the files for the module, the best place to put them is in one
of the locations PowerShell automatically looks for PowerShell modules. If
you install the module for just you, then you should place the module in your
Documents directory under
folder(s) may not already exist. If so, you should create them yourself.
Alternatively if you want to make the module(s) available to any user on the
local machine you can place them in
To see where Windows PowerShell will look to auto-import modules in your environment, type
$env:PSModulePath -split ';'
The structure for the Modules folder is that the first level includes a folder
matching the name of the module, and the subfolder contains one or more
versions of that module where the name of the folder matches the exact version
of the module as defined in the
*.psd1 file at the root of the specific
module's folder. In the example below, we have MilestonePSTools version
21.2.2, and inside that folder are the contents from the screenshot above
such that MilestonePSTools.psd1 exists inside the folder named "21.1.451603".
Modules/ |---MilestonePSTools/ | |---21.2.2/ | |---MilestonePSTools.psd1 |---MipSdkRedist/ | |---21.2.0/ | |---MipSdkRedist.psd1
Once you have the modules extracted and placed in the right location, you
should be able to run
Import-Module MilestonePSTools and both MipSdkRedist
and MilestonePSTools will be loaded into your PowerShell session. If you get an
error message, check out 01-CommonErrors to see if we've
already shared some tips on how to deal with it!