New-NBCustomField
Since
v4.4.10.0
SYNOPSIS
Creates a new custom field in Netbox.
SYNTAX
New-NBCustomField [-Name] <String> [[-Label] <String>] [-Type] <String> [-Object_Types] <String[]>
[[-Group_Name] <String>] [[-Description] <String>] [[-Required] <Boolean>] [[-Search_Weight] <UInt16>]
[[-Filter_Logic] <String>] [[-Ui_Visible] <String>] [[-Ui_Editable] <String>] [[-Is_Cloneable] <Boolean>]
[[-Default] <Object>] [[-Weight] <UInt16>] [[-Validation_Minimum] <Int64>] [[-Validation_Maximum] <Int64>]
[[-Validation_Regex] <String>] [[-Choice_Set] <UInt64>] [[-Tags] <Object[]>] [-Raw]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
Creates a new custom field in Netbox Extras module.
EXAMPLES
EXAMPLE 1
New-NBCustomField -Name "asset_id" -Label "Asset ID" -Type "text" -Object_Types @("dcim.device")
PARAMETERS
-Name
Internal name of the custom field.
```yaml Type: String Parameter Sets: (All) Aliases:
Required: True Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Label
Display label for the custom field.
```yaml Type: String Parameter Sets: (All) Aliases:
Required: False Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Type
Field type (text, longtext, integer, decimal, boolean, date, datetime, url, json, select, multiselect, object, multiobject).
```yaml Type: String Parameter Sets: (All) Aliases:
Required: True Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Object_Types
Content types this field applies to.
```yaml Type: String[] Parameter Sets: (All) Aliases:
Required: True Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Group_Name
Group name for organizing fields.
```yaml Type: String Parameter Sets: (All) Aliases:
Required: False Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Description
Description of the field.
```yaml Type: String Parameter Sets: (All) Aliases:
Required: False Position: 6 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Required
Whether this field is required.
```yaml Type: Boolean Parameter Sets: (All) Aliases:
Required: False Position: 7 Default value: False Accept pipeline input: False Accept wildcard characters: False ```
-Search_Weight
Search weight (0-32767).
```yaml Type: UInt16 Parameter Sets: (All) Aliases:
Required: False Position: 8 Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Filter_Logic
Filter logic (disabled, loose, exact).
```yaml Type: String Parameter Sets: (All) Aliases:
Required: False Position: 9 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Ui_Visible
UI visibility (always, if-set, hidden).
```yaml Type: String Parameter Sets: (All) Aliases:
Required: False Position: 10 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Ui_Editable
UI editability (yes, no, hidden).
```yaml Type: String Parameter Sets: (All) Aliases:
Required: False Position: 11 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Is_Cloneable
Whether the field is cloneable.
```yaml Type: Boolean Parameter Sets: (All) Aliases:
Required: False Position: 12 Default value: False Accept pipeline input: False Accept wildcard characters: False ```
-Default
Default value.
```yaml Type: Object Parameter Sets: (All) Aliases:
Required: False Position: 13 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Weight
Display weight.
```yaml Type: UInt16 Parameter Sets: (All) Aliases:
Required: False Position: 14 Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Validation_Minimum
Minimum value for numeric fields.
```yaml Type: Int64 Parameter Sets: (All) Aliases:
Required: False Position: 15 Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Validation_Maximum
Maximum value for numeric fields.
```yaml Type: Int64 Parameter Sets: (All) Aliases:
Required: False Position: 16 Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Validation_Regex
Validation regex pattern.
```yaml Type: String Parameter Sets: (All) Aliases:
Required: False Position: 17 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Choice_Set
Choice set ID for select fields.
```yaml Type: UInt64 Parameter Sets: (All) Aliases:
Required: False Position: 18 Default value: 0 Accept pipeline input: False Accept wildcard characters: False ```
-Tags
{{ Fill Tags Description }}
```yaml Type: Object[] Parameter Sets: (All) Aliases:
Required: False Position: 19 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Raw
Return the raw API response.
```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
System.Management.Automation.PSObject
NOTES
AddedInVersion: v4.4.10.0