PlagueHO / jenkins

PowerShell module for interacting with a CloudBees Jenkins server using the Jenkins Rest API.
MIT License
11 stars 28 forks source link

Get-JenkinsCrumb fails when IE unavailable #26

Open JesseHermes opened 1 year ago

JesseHermes commented 1 year ago

Issue

Before submitting your issue for the Jenkins project, please take a moment to provide the following details:

When calling Get-JenkinsCrumb on server OS with IE disabled, Invoke-WebRequest fails with an error 'The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.'

Adding -UseBasicParsing to the parameters resolved this issue

I was unable to test further due to Issue #3 and crumb, but UseBasicParsing would be needed anywhere Invoke-WebRequest or RestMethod is used. A quick search through the module, I see that it is included in the parameter set in some invocations but not all.

PlagueHO commented 1 year ago

Hi @JesseHermes - good catch. Yes, we should add -UseBasicParsing parameter to all IWR calls. Happy to take a PR or I'll get to it when I can (long backlog :cry:).