Connect(Setup): Fix indent (using Visual code Formatter)

This commit is contained in:
Alexis La Goutte 2021-07-21 22:06:00 +02:00
parent 1f89363cbd
commit b164ffe0b4

View file

@ -55,7 +55,8 @@
if (-not $Credential) {
try {
$Credential = Get-NetboxCredential -ErrorAction Stop
} catch {
}
catch {
# Credentials are not set... Try to obtain from the user
if (-not ($Credential = Get-Credential -UserName 'username-not-applicable' -Message "Enter token for Netbox")) {
throw "Token is necessary to connect to a Netbox API."
@ -85,12 +86,14 @@
try {
Write-Verbose "Verifying API connectivity..."
$null = VerifyAPIConnectivity
} catch {
}
catch {
Write-Verbose "Failed to connect. Generating error"
Write-Verbose $_.Exception.Message
if (($_.Exception.Response) -and ($_.Exception.Response.StatusCode -eq 403)) {
throw "Invalid token"
} else {
}
else {
throw $_
}
}