< Back

Update-Object

Sun Jan 19, 2020 5:45 pm

NAME Update-Object



SYNOPSIS

Requests an object and any if its children refresh themselves immediately.





SYNTAX

Update-Object -Object <SensorOrDeviceOrGroupOrProbe> [-Batch <SwitchParameter>] [-PassThru <SwitchParameter>]

[<CommonParameters>]



Update-Object -Id <int[]> [-Batch <SwitchParameter>] [-PassThru <SwitchParameter>] [<CommonParameters>]





DESCRIPTION

The Refresh-Object cmdlet causes an object to refresh itself. Sensor objects automatically refresh according to

their Scanning Interval. Refresh-Object allows you to bypass this interval and request the sensor update

immediately. If Refresh-Object is applied to a Device, Group or Probe, all sensors under that object will be

refreshed.



Sensor Factory sensors do not support being manually refreshed.



By default, Refresh-Object will operate in Batch Mode. In Batch Mode, Refresh-Object will not execute a request

for each individual object, but will rather store each item in a queue to refresh all objects at once, via a

single request. This allows PrtgAPI to be extremely performant in performing operations against a large number of

objects.



If the pipeline is cancelled (either due to a cmdlet throwing an exception or the user pressing Ctrl-C) before

fully completing, Refresh-Object will not generate a request against PRTG. If you wish to disable Batch Mode and

fully process objects individually one at a time, this can be achieved by specifying -Batch:$false.





PARAMETERS

-Object <SensorOrDeviceOrGroupOrProbe>

The object to refresh.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Id <int[]>

ID of the object to refresh.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Batch <SwitchParameter>

Specifies whether this cmdlet should queue all objects piped to this cmdlet to execute a single request

against PRTG for processing all objects. By default this value is true.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-PassThru <SwitchParameter>

Specifies whether to return the original PrtgObject that was passed to this cmdlet, allowing the object to be

further piped into additional cmdlets.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

PrtgAPI.SensorOrDeviceOrGroupOrProbe

The object to refresh.





OUTPUTS



---------- EXAMPLE 1 ----------



C:\\> Get-Sensor -Id 2001 | Refresh-Object



Refresh the sensor with object ID 2001.



---------- EXAMPLE 2 ----------



C:\\> Get-Device -Id 2000 | Refresh-Object



Refresh all sensors under the device with ID 2000.



---------- EXAMPLE 3 ----------



C:\\> Refresh-Object -Id 2001



Refreshes the object with the ID 2001



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wi ... #refresh-1

Get-Sensor

Get-Device

Get-Group

Get-Probe