powerbox icon indicating copy to clipboard operation
powerbox copied to clipboard

Get-nbIpAddress cannot search with assigned_object_id specified

Open thefreakquency opened this issue 3 years ago • 0 comments

It looks like there is a small bug with Get-nbIpAddress. When using Get-nbIpAddress -query @{assigned_object_id=5137} the result of this query returns all IP addresses contained in Netbox. If I use another query like Get-nbIpAddress -query @{id=17} I receive a single entry which is what's expected.

In the meantime, I do the query offline as a workaround, but it would be nice to leverage the API for a concise query:

$variable = Get-nbIpAddress
$variable | Where-Object {$_.assigned_object_ID -eq 5137}
$psversiontable
Name                           Value
----                           -----
PSVersion                      7.1.4
PSEdition                      Core
GitCommitId                    7.1.4
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

(Get-Module | Where-Object {$_.Name -eq 'powerbox'}).version

Major  Minor  Build  Revision
-----  -----  -----  --------
2      3      5      -1

thefreakquency avatar Aug 20 '21 19:08 thefreakquency