We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4e4a739 + e2923ca commit 7ac8a5cCopy full SHA for 7ac8a5c
SnipeitPS/Private/Invoke-SnipeitMethod.ps1
@@ -144,6 +144,10 @@ function Invoke-SnipeitMethod {
144
# This could be handled nicely in an function such as:
145
# ResolveError $response -WriteError
146
Write-Error $($webResponse.messages | Out-String)
147
+ } elseif ( $webResponse.StatusCode -eq 'Unauthorized') {
148
+ Write-Verbose "[$($MyInvocation.MyCommand.Name)] An Unauthorized response was received"
149
+ Write-Error "Cannot connect to Snipe It: Unauthorized."
150
+ return $false
151
} else {
152
#update operations return payload
153
if ($webResponse.payload) {
0 commit comments