From 17c4d9d779ad0e7d3114c2bbcef3784cdc5a4809 Mon Sep 17 00:00:00 2001 From: Ben Claussen Date: Thu, 22 Jul 2021 11:51:49 -0400 Subject: [PATCH] Add Get-NetboxVersion function --- Functions/Setup/Get-NetboxVersion.ps1 | 15 +++++++++++++++ NetboxPS.psproj | 1 + 2 files changed, 16 insertions(+) create mode 100644 Functions/Setup/Get-NetboxVersion.ps1 diff --git a/Functions/Setup/Get-NetboxVersion.ps1 b/Functions/Setup/Get-NetboxVersion.ps1 new file mode 100644 index 0000000..7dc8c03 --- /dev/null +++ b/Functions/Setup/Get-NetboxVersion.ps1 @@ -0,0 +1,15 @@ + +function Get-NetboxVersion { + [CmdletBinding()] + param () + + $Segments = [System.Collections.ArrayList]::new(@('status')) + + $URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary @{ + 'format' = 'json' + } + + $URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters -SkipConnectedCheck + + InvokeNetboxRequest -URI $URI +} diff --git a/NetboxPS.psproj b/NetboxPS.psproj index f78ceb1..b71197d 100644 --- a/NetboxPS.psproj +++ b/NetboxPS.psproj @@ -114,6 +114,7 @@ Functions\Setup\Set-NetboxUnstrustedSSL.ps1 Functions\Setup\Set-NetboxTimeout.ps1 Functions\Setup\Get-NetboxTimeout.ps1 + Functions\Setup\Get-NetboxVersion.ps1 R:\Netbox\NetboxPS\Test-Module.ps1 \ No newline at end of file