< Back

New-PropertyNode

Sun Jan 19, 2020 5:43 pm

NAME New-PropertyNode



SYNOPSIS

Creates a new PropertyNode for modelling a PRTG Tree.





SYNTAX

New-PropertyNode [-Property] <Either`2> [[-PropertyValue] <object>] -Object <PrtgObject> [<CommonParameters>]



New-PropertyNode [-Value] <PropertyValuePair> [<CommonParameters>]



New-PropertyNode [-Property] <Either`2> [[-PropertyValue] <object>] -Id <int> [<CommonParameters>]





DESCRIPTION

The New-PropertyNode cmdlet creates a new PropertyNode object for modelling a PRTG Tree. Each PropertyNode object

encapsulates a single PropertyValuePair object.



If an existing PropertyValuePair from a PRTG Tree is not specified or piped to the -Value parameter, the -Id or

-Object, Property and optional PropertyValue can be specified to identify the information that should be

encapsulated in a node. If a -PropertyValue is not specified, New-PropertyNode will perform a lookup against the

specified -Property to get the current property value from PRTG. -Property accepts both raw property names as well

as type safe ObjectProperty values.





PARAMETERS

-Object <PrtgObject>

The object that contains the property.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Value <PropertyValuePair>

The value to use for the node.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Id <int>

The ID of the object containing the property.



Required? true

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Property <Either`2>

The ObjectProperty or raw property to retrieve.



Required? true

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PropertyValue <object>

The value of the property. If this value is emitted, New-PropertyNode will resolve the Property value from

PRTG.



Required? false

Position? 1

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

The object that contains the property.



PrtgAPI.Tree.PropertyValuePair

The value to use for the node.





OUTPUTS



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



C:\\> $node.Value | New-PropertyNode



Create a property node from the PropertyValuePair of an existing node.



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



C:\\> Get-Sensor -Id 1001 | New-PropertyNode Name Ping



Create a property node for the Name property with the value "Ping" for the object ID 1001.



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



New-PropertyNode -Id 1001 Name Ping



Create a property node for the Name property with the value "Ping" for the object ID 1001.



---------- EXAMPLE 4 ----------



New-PropertyNode -Id 1001 Name



Create a property node with the current value of the Name property for the object with ID 1001.



---------- EXAMPLE 5 ----------



New-PropertyNode -Id 1001 name_



Create a property node with the current value of the name_ raw property for the object with ID 1001.



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wiki/Tree-Creation

New-SensorNode

New-DeviceNode

New-GroupNode

New-ProbeNode

New-TriggerNode