< Back

Test-ErrorStatus

Sun Jan 19, 2020 5:45 pm

NAME Test-ErrorStatus



SYNOPSIS

Simulates an error status on a PRTG Sensor.





SYNTAX

Test-ErrorStatus -Sensor <Sensor> [-Batch <SwitchParameter>] [-PassThru <SwitchParameter>] [<CommonParameters>]



Test-ErrorStatus -Id <int[]> [-Batch <SwitchParameter>] [-PassThru <SwitchParameter>] [<CommonParameters>]





DESCRIPTION

The Simulate-ErrorStatus cmdlet forces a PRTG Sensor to enter an error (Down) state. When an object is in a

simulated error status, it will display a message indicating it is in a simulated error state. Any object put into

a simulated error status will remain in this state until the object is resumed via the Resume-Object cmdlet or via

the PRTG UI. Even if an object in a simulated error state is paused, it will return to this state when the object

is unpaused.



By default, Simulate-ErrorStatus will operate in Batch Mode. In Batch Mode, Simulate-ErrorStatus will not execute

a request for each individual object, but will rather store each item in a queue to simulate errors for 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, Simulate-ErrorStatus 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

-Sensor <Sensor>

The sensor to simulate an error status on.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Id <int[]>

The ID of the sensor to simulate an error status on.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SensorId <int[]>

The ID of the sensor to simulate an error status on.



This is an alias of the Id parameter.



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.Sensor

The sensor to simulate an error status on.





OUTPUTS



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



C:\\> Get-Sensor -Id 1001 | Simulate-ErrorStatus



Force the sensor with ID 1001 to enter an error state.



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



C:\\> Simulate-ErrorStatus -Id 1001



Force the sensor with ID 1001 to enter an error state.



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wi ... te-error-1

Resume-Object