mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
InvokeNetboxRequest(Helpers): Fix indent (using Visual Code Formatter)
This commit is contained in:
parent
4ad0562466
commit
2bf4ed6f6f
1 changed files with 28 additions and 26 deletions
|
|
@ -38,13 +38,13 @@ function InvokeNetboxRequest {
|
|||
$Headers.Authorization = "Token {0}" -f $creds.GetNetworkCredential().Password
|
||||
|
||||
$splat = @{
|
||||
'Method' = $Method
|
||||
'Uri' = $URI.Uri.AbsoluteUri # This property auto generates the scheme, hostname, path, and query
|
||||
'Headers' = $Headers
|
||||
'TimeoutSec' = $Timeout
|
||||
'Method' = $Method
|
||||
'Uri' = $URI.Uri.AbsoluteUri # This property auto generates the scheme, hostname, path, and query
|
||||
'Headers' = $Headers
|
||||
'TimeoutSec' = $Timeout
|
||||
'ContentType' = 'application/json'
|
||||
'ErrorAction' = 'Stop'
|
||||
'Verbose' = $VerbosePreference
|
||||
'Verbose' = $VerbosePreference
|
||||
}
|
||||
|
||||
if ($Body) {
|
||||
|
|
@ -93,11 +93,13 @@ function InvokeNetboxRequest {
|
|||
if ($Raw) {
|
||||
Write-Verbose "Returning raw result by choice"
|
||||
return $result
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ($result.psobject.Properties.Name.Contains('results')) {
|
||||
Write-Verbose "Found Results property on data, returning results directly"
|
||||
return $result.Results
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Write-Verbose "Did NOT find results property on data, returning raw result"
|
||||
return $result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue