-
-
Notifications
You must be signed in to change notification settings - Fork 38
Installation
PrtgAPI can be installed in Visual Studio or PowerShell 5+ via the Install-Package
cmdlet
Install-Package PrtgAPI
When installing into PowerShell, if you have both the nuget.org and PowerShell Gallery package sources installed on your machine, you will need to specify the source you wish to install from, e.g.
Install-Package PrtgAPI -Source PSGallery
If you are using Windows PowerShell, due to the PowerShell Gallery now requiring TLS 1.2 you may need to manually specify to use TLS 1.2 first in order to install or update PrtgAPI
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
You can confirm PrtgAPI has installed properly by invoking the command Import-Module PrtgAPI
. If you get an error about your execution policy, you may need to relax your execution policy to either RemoteSigned
or Unrestricted
Set-ExecutionPolicy RemoteSigned
To update to the latest release, use the Update-Module
cmdlet (Update-Package
in Visual Studio)
Update-Module PrtgAPI
If PrtgAPI has already been loaded into the current PowerShell session, you will need to close and re-open PowerShell in order to load the new version.
If you are using Windows PowerShell, due to the PowerShell Gallery now requiring TLS 1.2 you may need to manually specify to use TLS 1.2 first in order to install or update PrtgAPI
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
To uninstall PrtgAPI, use the Uninstall-Package
cmdlet
Uninstall-Package PrtgAPI
When using PowerShell, you will not be able to uninstall the package if the module has been loaded into the current session. This can be resolved by opening a new instance of PowerShell.
- Download the latest build
- Note that if a new build of PrtgAPI has not been released in the last 6 months, this URL will not work. The latest full release (
PrtgAPI.zip
) can be downloaded from the Releases page
- Note that if a new build of PrtgAPI has not been released in the last 6 months, this URL will not work. The latest full release (
- Right click PrtgAPI.zip -> Properties
- On the General tab, under Security select Unblock
- Unzip the file
- Add a reference to PrtgAPI.dll to your project, or import the PrtgAPI module into PowerShell via the command
Import-Module C:\path\to\PrtgAPI
. Alternatively, you can run the included PrtgAPI.cmd file to open a prompt and import the PrtgAPI module for you.