mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 01:42:28 +00:00
58 lines
No EOL
1.5 KiB
PowerShell
58 lines
No EOL
1.5 KiB
PowerShell
<#
|
|
.NOTES
|
|
===========================================================================
|
|
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172
|
|
Created on: 3/19/2020 12:44
|
|
Created by: Claussen
|
|
Organization: NEOnet
|
|
Filename: New-NetboxVirtualMachine.ps1
|
|
===========================================================================
|
|
.DESCRIPTION
|
|
A description of the file.
|
|
#>
|
|
|
|
|
|
function New-NetboxVirtualMachine {
|
|
[CmdletBinding()]
|
|
[OutputType([pscustomobject])]
|
|
param
|
|
(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Name,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[uint16]$Cluster,
|
|
|
|
[uint16]$Tenant,
|
|
|
|
[object]$Status = 'Active',
|
|
|
|
[uint16]$Role,
|
|
|
|
[uint16]$Platform,
|
|
|
|
[uint16]$vCPUs,
|
|
|
|
[uint16]$Memory,
|
|
|
|
[uint16]$Disk,
|
|
|
|
[uint16]$Primary_IP4,
|
|
|
|
[uint16]$Primary_IP6,
|
|
|
|
[hashtable]$Custom_Fields,
|
|
|
|
[string]$Comments
|
|
)
|
|
|
|
$PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
|
|
|
|
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'virtual-machines'))
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
|
|
|
InvokeNetboxRequest -URI $URI -Method POST -Body $URIComponents.Parameters
|
|
} |