NetboxPS/Functions/Virtualization/VirtualMachineInterface/Add-NetboxVirtualMachineInterface.ps1

45 lines
1.1 KiB
PowerShell
Raw Normal View History

<#
2020-03-23 12:18:01 -04:00
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172
Created on: 3/19/2020 12:46
Created by: Claussen
Organization: NEOnet
Filename: Add-NetboxVirtualMachineInterface.ps1
===========================================================================
.DESCRIPTION
A description of the file.
#>
function Add-NetboxVirtualMachineInterface {
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[string]$Name,
2020-03-23 12:18:01 -04:00
[Parameter(Mandatory = $true)]
[uint16]$Virtual_Machine,
2020-03-23 12:18:01 -04:00
[boolean]$Enabled = $true,
2020-03-23 12:18:01 -04:00
[string]$MAC_Address,
2020-03-23 12:18:01 -04:00
[uint16]$MTU,
2020-03-23 12:18:01 -04:00
[string]$Description,
2020-03-23 12:18:01 -04:00
[switch]$Raw
)
2020-03-23 12:18:01 -04:00
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'interfaces'))
2020-03-23 12:18:01 -04:00
$PSBoundParameters.Enabled = $Enabled
2020-03-23 12:18:01 -04:00
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
2020-03-23 12:18:01 -04:00
$uri = BuildNewURI -Segments $URIComponents.Segments
2020-03-23 12:18:01 -04:00
InvokeNetboxRequest -URI $uri -Method POST -Body $URIComponents.Parameters
}