< Back

New-ProbeNode

Sun Jan 19, 2020 5:43 pm

NAME New-ProbeNode



SYNOPSIS

Creates a new ProbeNode for modelling a PRTG Tree.





SYNTAX

New-ProbeNode [-Value] <Probe> [[-ScriptBlock] <ScriptBlock>] [<CommonParameters>]



New-ProbeNode [-Value] <Probe> -Children <PrtgNode[]> [<CommonParameters>]



New-ProbeNode [[-Name] <object[]>] [[-ScriptBlock] <ScriptBlock>] [-Id <int[]>] [<CommonParameters>]



New-ProbeNode [[-Name] <object[]>] -Children <PrtgNode[]> [-Id <int[]>] [<CommonParameters>]





DESCRIPTION

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

encapsulates a single Probe object along with any optional children (such as GroupNode and DeviceNode items).



New-ProbeNode supports many different ways of being invoked, however at its core there are two pieces of

information that can be provided to the cmdlet: information that identifies the Probe to encapsulate, and the

nodes that should be used as the children of the node.



If an existing Probe object retrieved from the Get-Probe cmdlet is not specified or piped to the -Value parameter,

one or more of -Name or -Id must be specified to identify the object to encapsulate. If multiple values are

returned as a result of these parameters, a unique ProbeNode object will be created for each item.



Child nodes to this node can either be specified via the pipeline, or declaratively via a ScriptBlock. When a

ScriptBlock defining children is specified, ProbeNode will incorporate a copy of the children in each ProbeNode

that is produced. While each ProbeNode will end up with a unique copy of all its descendant nodes, the underlying

Value of each nodw will be the same.





PARAMETERS

-Value <Probe>

The value to use for the node.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Name <object[]>

The name of the object to retrieve. Can include wildcards.



Required? false

Position? 0

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Id <int[]>

The ID of the object to retrieve.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ObjectId <int[]>

The ID of the object to retrieve.



This is an alias of the Id parameter.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ScriptBlock <ScriptBlock>

A script block that returns the children to use for this node.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Children <PrtgNode[]>

The children to use for the node.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

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

The value to use for the node.



PrtgAPI.Tree.PrtgNode[]

The children to use for the node.





OUTPUTS



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



C:\\> Get-Probe -Id 3001 | New-ProbeNode



Create a probe node from the probe with ID 3001.



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



C:\\> New-ProbeNode -Id 3001



Create a probe node from the probe with ID 3001.



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



C:\\> New-ProbeNode windows*



Create a probe node for each probe whose name starts with "windows".



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



C:\\> ProbeNode -Id 3001 {

>> DeviceNode -Id 2001 {

>> SensorNode -Id 1001

>> }

>>

>> DeviceNode -Id 2002 {

>> SensorNode -Id 1002

>> }

>> }



Create a new probe node from the object with ID 3001 with child nodes for the devices with IDs 2001 and 2002,

which contain the sensors with IDs 1001 and 1002 respectively.



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



New-Device -Id 2001,2002 | New-ProbeNode -Id 3001



Create a new probe node from the object with ID 3001 with child nodes for the devices with IDs 2001 and 2002.



RELATED LINKS

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

Get-Probe

New-SensorNode

New-DeviceNode

New-GroupNode

New-TriggerNode

New-PropertyNode