mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
Fix logic for bound parameters
This commit is contained in:
commit
af5315d43a
1 changed files with 6 additions and 4 deletions
|
|
@ -68,11 +68,13 @@ function Set-NetboxIPAMAddress {
|
|||
|
||||
process {
|
||||
foreach ($IPId in $Id) {
|
||||
if ((-not [string]::IsNullOrWhiteSpace($Assigned_Object_Id))-and [string]::IsNullOrWhiteSpace($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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue