New-NBDCIMDevice
Since
v1.0.4
SYNOPSIS
Creates one or more devices in Netbox DCIM module.
SYNTAX
Single (Default)
New-NBDCIMDevice -Name <String> -Role <Object> -Device_Type <Object> -Site <UInt64> [-Status <String>]
[-Platform <UInt64>] [-Tenant <UInt64>] [-Cluster <UInt64>] [-Rack <UInt64>] [-Position <UInt16>]
[-Face <String>] [-Serial <String>] [-Asset_Tag <String>] [-Virtual_Chassis <UInt64>] [-VC_Priority <UInt64>]
[-VC_Position <UInt64>] [-Primary_IP4 <UInt64>] [-Primary_IP6 <UInt64>] [-Comments <String>]
[-Description <String>] [-Custom_Fields <Hashtable>] [-Owner <UInt64>] [-Tags <Object[]>] [-Raw]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Bulk
New-NBDCIMDevice -InputObject <PSObject> [-BatchSize <Int32>] [-Force] [-Tags <Object[]>] [-Raw]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
Creates a new device in Netbox DCIM module. Supports both single device creation with individual parameters and bulk creation via pipeline input.
For bulk operations, use the -BatchSize parameter to control how many devices are sent per API request. This significantly improves performance when creating many devices.
EXAMPLES
EXAMPLE 1
New-NBDCIMDevice -Name "server01" -Role 1 -Device_Type 1 -Site 1
Creates a single device named "server01".
EXAMPLE 2
$devices = @(
[PSCustomObject]@{Name="srv01"; Role=1; Device_Type=1; Site=1}
[PSCustomObject]@{Name="srv02"; Role=1; Device_Type=1; Site=1}
)
$devices | New-NBDCIMDevice -BatchSize 50
Creates multiple devices using bulk API operations.
EXAMPLE 3
1..100 | ForEach-Object {
[PSCustomObject]@{Name="srv$_"; Role=1; Device_Type=1; Site=1}
} | New-NBDCIMDevice -BatchSize 50 -Force
Creates 100 devices in 2 bulk API calls, skipping confirmation.
PARAMETERS
-Name
The name of the device. Required for single device creation.
```yaml Type: String Parameter Sets: Single Aliases:
Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Role
The device role ID or name. Required for single device creation. Alias: Device_Role (backwards compatibility with Netbox 3.x)
```yaml Type: Object Parameter Sets: Single Aliases: Device_Role
Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Device_Type
The device type ID. Required for single device creation.
```yaml Type: Object Parameter Sets: Single Aliases:
Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Site
The site ID. Required for single device creation.
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: True Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Status
{{ Fill Status Description }}
```yaml Type: String Parameter Sets: Single Aliases:
Required: False Position: Named Default value: Active Accept pipeline input: False Accept wildcard characters: False ```
-Platform
{{ Fill Platform Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Tenant
{{ Fill Tenant Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Cluster
{{ Fill Cluster Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Rack
{{ Fill Rack Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Position
{{ Fill Position Description }}
```yaml Type: UInt16 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Face
{{ Fill Face Description }}
```yaml Type: String Parameter Sets: Single Aliases:
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Serial
{{ Fill Serial Description }}
```yaml Type: String Parameter Sets: Single Aliases:
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Asset_Tag
{{ Fill Asset_Tag Description }}
```yaml Type: String Parameter Sets: Single Aliases:
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Virtual_Chassis
{{ Fill Virtual_Chassis Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-VC_Priority
{{ Fill VC_Priority Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-VC_Position
{{ Fill VC_Position Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Primary_IP4
{{ Fill Primary_IP4 Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Primary_IP6
{{ Fill Primary_IP6 Description }}
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Comments
{{ Fill Comments Description }}
```yaml Type: String Parameter Sets: Single Aliases:
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Description
Short description of the device (optional).
```yaml Type: String Parameter Sets: Single Aliases:
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Custom_Fields
{{ Fill Custom_Fields Description }}
```yaml Type: Hashtable Parameter Sets: Single Aliases:
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Owner
The owner ID for object ownership (Netbox 4.5+ only).
```yaml Type: UInt64 Parameter Sets: Single Aliases:
Required: False Position: Named Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-InputObject
Pipeline input for bulk operations. Each object should contain the required properties: Name, Role, Device_Type, Site.
```yaml Type: PSObject Parameter Sets: Bulk Aliases:
Required: True Position: Named Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ```
-BatchSize
Number of devices to create per API request in bulk mode. Default: 0 (no batching - backwards compatible single-item mode) Range: 1-1000
```yaml Type: Int32 Parameter Sets: Bulk Aliases:
Required: False Position: Named Default value: 100 Accept pipeline input: False Accept wildcard characters: False ```
-Force
Skip confirmation prompts for bulk operations.
```yaml Type: SwitchParameter Parameter Sets: Bulk Aliases:
Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ```
-Tags
Common parameters
```yaml Type: Object[] Parameter Sets: (All) Aliases:
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Raw
Return the raw API response instead of the results array.
```yaml Type: SwitchParameter Parameter Sets: (All) Aliases:
Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ```
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: wi
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Confirm
Prompts you for confirmation before running the cmdlet.
```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: cf
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-ProgressAction
{{ Fill ProgressAction Description }}
```yaml Type: ActionPreference Parameter Sets: (All) Aliases: proga
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
[PSCustomObject] The created device object(s).
[BulkOperationResult] When using -BatchSize, returns bulk operation result.
NOTES
AddedInVersion: v1.0.4