Increment version to 1.3.0

This commit is contained in:
Ben Claussen 2021-03-25 16:45:40 -04:00
parent ad4c80e4f6
commit 6d00855644
4 changed files with 108 additions and 9 deletions

View file

@ -3,7 +3,7 @@
#
# Generated by: Ben Claussen
#
# Generated on: 2020-12-08
# Generated on: 2021-03-25
#
@{
@ -12,7 +12,7 @@
RootModule = 'NetboxPS.psm1'
# Version number of this module.
ModuleVersion = '1.2.2'
ModuleVersion = '1.3.0'
# Supported PSEditions
# CompatiblePSEditions = @()

View file

@ -103,7 +103,7 @@
<File Build="0" Shared="True" ReferenceFunction="Invoke-Get-NetboxCircuitProvider_ps1" ExportFunctions="True">Functions\Circuits\Providers\Get-NetboxCircuitProvider.ps1</File>
<File Build="0" Shared="True" ReferenceFunction="Invoke-Get-NetboxCircuitType_ps1" ExportFunctions="True">Functions\Circuits\Types\Get-NetboxCircuitType.ps1</File>
<File Build="0" Shared="True" ReferenceFunction="Invoke-Get-ModelDefinition_ps1" ExportFunctions="True">Functions\Helpers\Get-ModelDefinition.ps1</File>
<File Build="2" Shared="True" ReferenceFunction="Invoke-Set-NetboxIPAMPrefix_ps1" ExportFunctions="False">Functions\IPAM\Prefix\Set-NetboxIPAMPrefix.ps1</File>
<File Build="0" Shared="True" ReferenceFunction="Invoke-Set-NetboxIPAMPrefix_ps1" ExportFunctions="True">Functions\IPAM\Prefix\Set-NetboxIPAMPrefix.ps1</File>
</Files>
<StartupScript>R:\Netbox\NetboxPS\Test-Module.ps1</StartupScript>
</Project>

View file

@ -3,7 +3,7 @@
#
# Generated by: Ben Claussen
#
# Generated on: 2020-12-08
# Generated on: 2021-03-25
#
@{
@ -12,7 +12,7 @@
RootModule = 'NetboxPS.psm1'
# Version number of this module.
ModuleVersion = '1.2.2'
ModuleVersion = '1.3.0'
# Supported PSEditions
# CompatiblePSEditions = @()

View file

@ -4300,10 +4300,12 @@ function Set-NetboxIPAMAddress {
process {
foreach ($IPId in $Id) {
if ((-not [string]::IsNullOrWhiteSpace($Assigned_Object_Id))-and [string]::IsNullOrWhiteSpace($Assigned_Object_Type)) {
throw "Assigned_Object_Type is required when specifying Assigned_Object_Id"
} elseif ((-not [string]::IsNullOrWhiteSpace($Assigned_Object_Type)) -and [string]::IsNullOrWhiteSpace($Assigned_Object_Id)) {
throw "Assigned_Object_Id is required when specifying Assigned_Object_Type"
if ($PSBoundParameters.ContainsKey('Assigned_Object_Type') -or $PSBoundParameters.ContainsKey('Assigned_Object_Id')) {
if ((-not [string]::IsNullOrWhiteSpace($Assigned_Object_Id)) -and [string]::IsNullOrWhiteSpace($Assigned_Object_Type)) {
throw "Assigned_Object_Type is required when specifying Assigned_Object_Id"
} elseif ((-not [string]::IsNullOrWhiteSpace($Assigned_Object_Type)) -and [string]::IsNullOrWhiteSpace($Assigned_Object_Id)) {
throw "Assigned_Object_Id is required when specifying Assigned_Object_Type"
}
}
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses', $IPId))
@ -4322,6 +4324,103 @@ function Set-NetboxIPAMAddress {
}
}
#endregion
#region File Set-NetboxIPAMPrefix.ps1
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2021 v5.8.186
Created on: 2021-03-23 13:54
Created by: Claussen
Organization: NEOnet
Filename: Set-NetboxIPAMPrefix.ps1
===========================================================================
.DESCRIPTION
A description of the file.
#>
function Set-NetboxIPAMPrefix {
[CmdletBinding(ConfirmImpact = 'Medium',
SupportsShouldProcess = $true)]
param
(
[Parameter(Mandatory = $true,
ValueFromPipelineByPropertyName = $true)]
[uint16[]]$Id,
[string]$Prefix,
[string]$Status,
[uint16]$Tenant,
[uint16]$Site,
[uint16]$VRF,
[uint16]$VLAN,
[object]$Role,
[hashtable]$Custom_Fields,
[string]$Description,
[switch]$Is_Pool,
[switch]$Force
)
begin {
# Write-Verbose "Validating enum properties"
# $Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses', 0))
$Method = 'PATCH'
#
# # Value validation
# $ModelDefinition = GetModelDefinitionFromURIPath -Segments $Segments -Method $Method
# $EnumProperties = GetModelEnumProperties -ModelDefinition $ModelDefinition
#
# foreach ($Property in $EnumProperties.Keys) {
# if ($PSBoundParameters.ContainsKey($Property)) {
# Write-Verbose "Validating property [$Property] with value [$($PSBoundParameters.$Property)]"
# $PSBoundParameters.$Property = ValidateValue -ModelDefinition $ModelDefinition -Property $Property -ProvidedValue $PSBoundParameters.$Property
# } else {
# Write-Verbose "User did not provide a value for [$Property]"
# }
# }
#
# Write-Verbose "Finished enum validation"
}
process {
foreach ($PrefixId in $Id) {
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'prefixes', $PrefixId))
Write-Verbose "Obtaining Prefix from ID $PrefixId"
$CurrentPrefix = Get-NetboxIPAMPrefix -Id $PrefixId -ErrorAction Stop
if ($Force -or $PSCmdlet.ShouldProcess($CurrentPrefix.Prefix, 'Set')) {
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id', 'Force'
$URI = BuildNewURI -Segments $URIComponents.Segments
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method $Method
}
}
}
}
#endregion
#region File Set-NetboxVirtualMachine.ps1