mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-15 02:35:46 +00:00
33 lines
No EOL
922 B
PowerShell
33 lines
No EOL
922 B
PowerShell
|
|
function New-NetboxDCIMManufacture {
|
|
[CmdletBinding(ConfirmImpact = 'low',
|
|
SupportsShouldProcess = $true)]
|
|
[OutputType([pscustomobject])]
|
|
#region Parameters
|
|
param
|
|
(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Name,
|
|
|
|
[string]$Description,
|
|
|
|
[hashtable]$Custom_Fields
|
|
|
|
)
|
|
#endregion Parameters
|
|
|
|
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'manufacturers'))
|
|
$Method = 'POST'
|
|
|
|
if (-not $PSBoundParameters.ContainsKey('slug')) {
|
|
$PSBoundParameters.Add('slug', (GenerateSlug -Slug $name))
|
|
}
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
|
|
|
if ($PSCmdlet.ShouldProcess($Name, 'Create new Manufacture')) {
|
|
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters
|
|
}
|
|
} |