Fix order of operations for Connect-NetboxAPI

- Move successful connection boolean declaration before call to Get-NetboxContentType
This commit is contained in:
Ben Claussen 2023-02-24 12:12:54 -05:00
parent 010fb0410b
commit 3e0d817267

View file

@ -145,19 +145,10 @@
Write-Verbose "Found compatible version [$($script:NetboxConfig.NetboxVersion.'netbox-version')]!"
}
$script:NetboxConfig.ContentTypes = Get-NetboxContentType -Limit 500
$script:NetboxConfig.Connected = $true
Write-Verbose "Successfully connected!"
#Write-Verbose "Caching static choices"
#$script:NetboxConfig.Choices.Circuits = Get-NetboxCircuitsChoices
#$script:NetboxConfig.Choices.DCIM = Get-NetboxDCIMChoices # Not completed yet
#$script:NetboxConfig.Choices.Extras = Get-NetboxExtrasChoices
#$script:NetboxConfig.Choices.IPAM = Get-NetboxIPAMChoices
##$script:NetboxConfig.Choices.Secrets = Get-NetboxSecretsChoices # Not completed yet
##$script:NetboxConfig.Choices.Tenancy = Get-NetboxTenancyChoices
#$script:NetboxConfig.Choices.Virtualization = Get-NetboxVirtualizationChoices
$script:NetboxConfig.ContentTypes = Get-NetboxContentType -Limit 500
Write-Verbose "Connection process completed"
}