-
-
Notifications
You must be signed in to change notification settings - Fork 38
Progress
If Connect-PrtgServer
is executed outside of a script or the PowerShell ISE, PrtgAPI will by default display advanced progress details whenever two cmdlets are chained together. PrtgAPI dynamically updates the progress hierarchy based on number and type of cmdlets being executed. Progress is displayed when two or more PrtgAPI cmdlets are piped together, or when a variable containing two or more PrtgAPI objects is piped into a PrtgAPI cmdlet.
# PRTG Group Search
# Processing group 1/1
# [oooooooooooooooooooooooooooooooooooooooo] (100%)
Get-Group -Count 1 | Get-Device
# PRTG Group Search
# Processing group 1/1
# [oooooooooooooooooooooooooooooooooooooooo] (100%)
# PRTG Device Search
# Processing device 1/1
# [oooooooooooooooooooooooooooooooooooooooo] (100%)
# Retrieving all sensors
Get-Group -Count 1 | Get-Device | Get-Sensor
With the exception of the Where-Object
cmdlet and certain parameter combinations of Select-Object
, if PrtgAPI detects that a third party cmdlet (such as Foreach-Object
) is sitting between two PrtgAPI cmdlets, progress from all cmdlets to the right of of this third party cmdlet will not attempt to display progress. If a script block is used in conjunction with a cmdlet in a PrtgAPI pipeline (such as Where-Object) containing further PrtgAPI cmdlets, a second hierarchy of progress will be created separate from the first.
If you do not wish to display PrtgAPI Progress, this can be overridden by either setting the $ProgressPreference
within PowerShell, specifying the -Progress
parameter with Connect-PrtgServer
, updating the progress with Set-PrtgClient
or by using the Enable-PrtgProgress
and Disable-PrtgProgress
cmdlets respectively.
Connect-PrtgServer prtg.example.com -Progress:$false
Set-PrtgClient -Progress
Enable-PrtgProgress