PrtgAPI.psm1

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
New-Alias Add-Trigger Add-NotificationTrigger
New-Alias Edit-TriggerProperty Edit-NotificationTriggerProperty
New-Alias Get-Trigger Get-NotificationTrigger
New-Alias Get-TriggerTypes Get-NotificationTriggerTypes
New-Alias New-TriggerParameters New-NotificationTriggerParameters
New-Alias Remove-Trigger Remove-NotificationTrigger
New-Alias Set-Trigger Set-NotificationTrigger

New-Alias Set-ChannelSetting Set-ChannelProperty
New-Alias Set-ObjectSetting Set-ObjectProperty
New-Alias Get-ObjectSetting Get-ObjectProperty

New-Alias Acknowledge-Sensor Confirm-Sensor
New-Alias Pause-Object Suspend-Object
New-Alias Refresh-Object Update-Object
New-Alias Refresh-SystemInfo Update-SystemInfo
New-Alias Clone-Object Copy-Object
New-Alias Sort-PrtgObject Start-SortPrtgObject
New-Alias Simulate-ErrorStatus Test-ErrorStatus
New-Alias Load-PrtgConfigFile Sync-PrtgConfigFile

New-Alias Connect-GoPrtg Connect-GoPrtgServer
New-Alias Install-GoPrtg Install-GoPrtgServer
New-Alias Uninstall-GoPrtg Uninstall-GoPrtgServer

New-Alias GoPrtg Connect-GoPrtgServer

New-Alias flt New-SearchFilter

New-Alias Restart-PrtgProbe Restart-Probe

$ErrorActionPreference = "Stop"

$functions = Get-ChildItem "$PSScriptRoot\Functions"

# Each function also needs to be manually exported in the psd1
foreach($function in $functions)
{
    . $function.FullName
}

# Export-ModuleMember with no arguments should export nothing, but this doesn't work
Export-ModuleMember New-Credential
Export-ModuleMember -Alias *