snazy2000/SnipeitPS

Unable to Connect to SnipeItPS

RussellLeVasseur opened this issue · 1 comments

So I am in the beginning troubleshooting phase of this. Basically as of last night I am not unable to connect to SnipeIt via this module. The web works fine. I dove in to Invoke-SnipeItMethod and am now at this:

This error is throwing in Invoke-SnipeitMethod.ps1 at line 54. I tested with powershell 5 and powershell 7 (line 51). I get the same error.

New-Object : Cannot find an overload for "PSCredential" and the argument count: "2".
At line:54 char:28
+ ...  $Token =  (New-Object PSCredential "user",$SnipeitPSSession.apiKey). ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands. 
   NewObjectCommand

Powershell Version:

PS C:\windows\system32> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      22000  832   

SnipeIT Version:
image

I am seeing no errors in laravel logs for the API. Not sure if there is anywhere else i need to look?

I am currently building a function to just send basic requests to the API and will see if that works. I will publish updates below as I obtain findings.

Closing this because the issue was an SSL certificate issue.