cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
538
Views
0
Helpful
2
Replies
Highlighted
Enthusiast

UCSD's PowerShell Agent and Invoke-WebRequest/Invoke-RestMethod

Anyone else tried this?  For some reason, I had an account that this WAS working with.  Now, each time I present a script to the PSA that includes either of these two cmdlets to it, I get an error with the PSA (Object reference not set to an instance of an object.  Error 3).  Strangely enough, through PSSessions on the PSAs, I can run the scripts without an issue.  Makes me believe that those two cmdlets are persona non grata when it comes to the PSA.  Really makes for tough integrations with other 3rd parties, especially for those of us that are much much stronger with PowerShell than we are with JavaScript.

Now, if this is in fact as designed, I'd really REALLY love for it to actually show up in the documentation.  Otherwise, you might have people (like myself) trying to figure out what the hell to do with 800-1000 lines of code we've written for various functionality.

2 REPLIES 2
Highlighted
Enthusiast

Re: UCSD's PowerShell Agent and Invoke-WebRequest/Invoke-RestMethod

Never mind.  I seem to have figured out there's something wrong with the PowerShell PSSession the PSA seems to spawn.  I can nest a New-PSSession within that session and everything works fine.  I did resort to stop using Invoke-RestMethod and did JSON and XML conversions of output coming back from Invoke-WebRequest (specifically the Content property) and doing what I needed to do.  Will likely be logging this as a question (along with the hope that this gets escalate for bug fix).

Highlighted
Enthusiast

Re: UCSD's PowerShell Agent and Invoke-WebRequest/Invoke-RestMethod

Ended up writing up a blog post about what I did while waiting on an answer on whether this is an intended "feature" or a bug.

Using Invoke-WebRequest with the Cisco PowerShell Agent | snoopj's Blog

CreatePlease to create content
Content for Community-Ad

Cisco COVID-19 Survey