< Back

Set-ObjectPosition

Sun Jan 19, 2020 5:45 pm

NAME Set-ObjectPosition



SYNOPSIS

Adjusts the position of an object within its parent.





SYNTAX

Set-ObjectPosition [-Position] <Position> -Object <SensorOrDeviceOrGroupOrProbe> [-PassThru <SwitchParameter>]

[<CommonParameters>]



Set-ObjectPosition [-Position] <Position> -Id <int> [-PassThru <SwitchParameter>] [<CommonParameters>]





DESCRIPTION

The Set-ObjectPosition cmdlet adjusts the position of an object under its parent node. Set-ObjectPosition allows

you to specify either the direction to move the object in (Up, Down, Top, Bottom) or an absolute number to move

the object to a fixed position. If a numeric position lower than 1 or higher than the total number of objects

under the parent object is specified, PRTG will automatically move the object to the top or bottom of the list.





PARAMETERS

-Object <SensorOrDeviceOrGroupOrProbe>

The object to reposition.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Id <int>

ID of the object to reposition.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Position <Position>

Position to move the object to. If this value is higher than the number of items in the parent object, this

object will be moved to the position closest possible position.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PassThru <SwitchParameter>

Specifies whether to return the original IObject 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 reposition.





OUTPUTS



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



C:\\> Get-Sensor -Id 3045 | Set-ObjectPosition 1



Move the sensor with ID 3045 to be first in the list under its parent.



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



C:\\> Get-Sensor -Id 1001 | Set-ObjectPosition Up



Move the sensor with ID 1001 up a single position from its current location.



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



C:\\> Set-ObjectPosition -Id 1001 Up



Move the object with ID 1001 uo a single position from its current location.



RELATED LINKS

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

Get-Sensor

Get-Device

Get-Group

Get-Probe