< Back

Set-ChannelProperty

Sun Jan 19, 2020 5:44 pm

NAME Set-ChannelProperty



SYNOPSIS

Modifies the value of a PRTG channel property.





SYNTAX

Set-ChannelProperty [-Property] {Unit | ValueLookup | ScalingMultiplication | ScalingDivision | ShowInGraph |

ColorMode | LineColor | LineWidth | HistoricValueMode | DecimalMode | DecimalPlaces | SpikeFilterEnabled |

SpikeFilterMax | SpikeFilterMin | PercentMode | PercentValue | LimitsEnabled | UpperErrorLimit | UpperWarningLimit

| LowerErrorLimit | LowerWarningLimit | ErrorLimitMessage | WarningLimitMessage} [[-Value] <object>] -Channel

<Channel> [-Batch <SwitchParameter>] [-PassThru <SwitchParameter>] [<CommonParameters>]



Set-ChannelProperty -Channel <Channel> [-Batch <SwitchParameter>] [-ColorMode {Automatic | Manual}] [-DecimalMode

{Automatic | All | Custom}] [-DecimalPlaces <double>] [-ErrorLimitMessage <string>] [-HistoricValueMode {Average |

Minimum | Maximum}] [-LimitsEnabled <bool>] [-LineColor <string>] [-LineWidth <int>] [-LowerErrorLimit <double>]

[-LowerWarningLimit <double>] [-PassThru <SwitchParameter>] [-PercentMode {Actual | PercentOfMax}] [-PercentValue

<double>] [-ScalingDivision <double>] [-ScalingMultiplication <double>] [-ShowInGraph <bool>] [-SpikeFilterEnabled

<bool>] [-SpikeFilterMax <double>] [-SpikeFilterMin <double>] [-Unit <string>] [-UpperErrorLimit <double>]

[-UpperWarningLimit <double>] [-ValueLookup <string>] [-WarningLimitMessage <string>] [<CommonParameters>]



Set-ChannelProperty [-Property] {Unit | ValueLookup | ScalingMultiplication | ScalingDivision | ShowInGraph |

ColorMode | LineColor | LineWidth | HistoricValueMode | DecimalMode | DecimalPlaces | SpikeFilterEnabled |

SpikeFilterMax | SpikeFilterMin | PercentMode | PercentValue | LimitsEnabled | UpperErrorLimit | UpperWarningLimit

| LowerErrorLimit | LowerWarningLimit | ErrorLimitMessage | WarningLimitMessage} [[-Value] <object>] -ChannelId

<int> -SensorId <int> [-Batch <SwitchParameter>] [-PassThru <SwitchParameter>] [<CommonParameters>]



Set-ChannelProperty -ChannelId <int> -SensorId <int> [-Batch <SwitchParameter>] [-ColorMode {Automatic | Manual}]

[-DecimalMode {Automatic | All | Custom}] [-DecimalPlaces <double>] [-ErrorLimitMessage <string>]

[-HistoricValueMode {Average | Minimum | Maximum}] [-LimitsEnabled <bool>] [-LineColor <string>] [-LineWidth

<int>] [-LowerErrorLimit <double>] [-LowerWarningLimit <double>] [-PassThru <SwitchParameter>] [-PercentMode

{Actual | PercentOfMax}] [-PercentValue <double>] [-ScalingDivision <double>] [-ScalingMultiplication <double>]

[-ShowInGraph <bool>] [-SpikeFilterEnabled <bool>] [-SpikeFilterMax <double>] [-SpikeFilterMin <double>] [-Unit

<string>] [-UpperErrorLimit <double>] [-UpperWarningLimit <double>] [-ValueLookup <string>] [-WarningLimitMessage

<string>] [<CommonParameters>]





DESCRIPTION

The Set-ChannelProperty cmdlet modifies properties and settings of PRTG Channels. All supported properties that

can be modified are typesafe, using the type of the property on the Channel object returned from Get-Channel.



When a value is specified, Set-ChannelProperty will attempt to parse the value into its expected type. If the type

cannot be parsed, an exception will be thrown indicating the type of the object specified and the type that was

expected. In the case of enums, Set-ChannelProperty will list all valid values of the target type so that you may

know exactly how to interface with the specified property. In the event you wish to modify multiple properties in

a single request, Set-ChannelProperty provides dynamically generated parameters for each property supported by

PrtgAPI.



In the event that a property is specified that has a dependency on another property ebing set (such as

UpperErrorLimit requiring LimitsEnabled be $true) Set-ChannelProperty will automatically assign the required

values such that the original property may be correctly enabled. If the parent of a property is set to the

opposite of a child property's required value PrtgAPI will automatically remove the value specified on the child

as well. For example, if LimitsEnabled is set to $false, all error and warning limit related properties will be

set to $null. If LimitsEnabled is later set to $true, you will need to repopulate the values of all error and

warning limit properties.



For a list of all settings currently supported by Set-ChannelProperty, see Get-Help about_ChannelSettings.



By default, Set-ChannelProperty will operate in Batch Mode. In Batch Mode, Set-ChannelProperty will not execute a

request for each individual object, but will rather store each item in a queue to modify channel properties 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, Set-ChannelProperty 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

-Channel <Channel>

Channel to set the properties of.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-SensorId <int>

ID of the channel's parent sensor.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-ChannelId <int>

ID of the channel to set the properties of.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Property <ChannelProperty>

Property of the channel to set.



Possible values: Unit, ValueLookup, ScalingMultiplication, ScalingDivision, ShowInGraph, ColorMode, LineColor,

LineWidth, HistoricValueMode, DecimalMode, DecimalPlaces, SpikeFilterEnabled, SpikeFilterMax, SpikeFilterMin,

PercentMode, PercentValue, LimitsEnabled, UpperErrorLimit, UpperWarningLimit, LowerErrorLimit,

LowerWarningLimit, ErrorLimitMessage, WarningLimitMessage



Required? true

Position? 0

Default value Unit

Accept pipeline input? false

Accept wildcard characters? false



-Value <object>

Value to set the property to.



Required? false

Position? 1

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



-Unit <string>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ValueLookup <string>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ScalingMultiplication <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ScalingDivision <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ShowInGraph <bool>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ColorMode <AutoMode>

Possible values: Automatic, Manual



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LineColor <string>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LineWidth <int>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HistoricValueMode <HistoricValueMode>

Possible values: Average, Minimum, Maximum



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DecimalMode <DecimalMode>

Possible values: Automatic, All, Custom



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DecimalPlaces <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SpikeFilterEnabled <bool>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SpikeFilterMax <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SpikeFilterMin <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PercentMode <PercentDisplay>

Possible values: Actual, PercentOfMax



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PercentValue <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LimitsEnabled <bool>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UpperErrorLimit <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UpperWarningLimit <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LowerErrorLimit <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LowerWarningLimit <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ErrorLimitMessage <string>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WarningLimitMessage <string>



Required? false

Position? named

Default value

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

Channel to set the properties of.





OUTPUTS



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



C:\\> Get-Sensor -Tags wmicpuloadsensor | Get-Channel Total | Set-ChannelProperty UpperErrorLimit 90



Set the upper error limit of the "Total" channel of all WMI CPU Load sensors to 90. Will also set LimitsEnabled to

$true



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



C:\\> $channels = Get-Sensor -Tags wmicpuloadsensor | Get-Channel Total



C:\\> $channels | Set-ChannelProperty -UpperErrorLimit 80 -LowerErrorLimit 20



Set the value of both the UpperErrorLimit and LowerErrorLimit in a single request.



RELATED LINKS

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

Get-Help ChannelSettings

Get-Channel

Get-Sensor

Set-ObjectProperty