Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - add switch to Set-IBConfig which will bypass proxy or set no proxy #66

Open
pubsquash opened this issue Feb 8, 2024 · 3 comments
Assignees

Comments

@pubsquash
Copy link

Hi I have found in our environment the proxy had to be disabled / bypassed with various PS code, in order to get the module to work.

#Proxy Bypassing, To bypass the proxy (use the direct connection), set it to null:
#PS5.1
[System.Net.HttpWebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy($null)

#PS7+
[System.Net.Http.HttpClient]::DefaultProxy = New-Object System.Net.Webproxy($null)

Would it be possible to implement this in the module with a switch to the Set-IBConfig command, similar to the -SkipCertificateCheck

Regards

@rmbolger rmbolger self-assigned this Feb 10, 2024
@rmbolger
Copy link
Owner

Hi @pubsquash, thanks for reaching out. Proxy support in the PowerShell web cmdlets has seemingly always been kind of a pain from what I can tell. I'll see what I can do though.

@pubsquash
Copy link
Author

Great thanks! Also getting this issue if running under an automation account, the Set-IBConfig call errors out:

Error occurred: System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Message' because it is null.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.PSScriptCmdlet.RunClause(Action1 clause, Object dollarUnderbar, Object inputToProcess)
at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()

But if I run a direct Invoke-webRequest with the automation account, all ok. Hope you can assist.

Regards

@rmbolger
Copy link
Owner

Sorry for the delay. Totally lost track of this. I can't say I've seen that error before. What sort of automation account is this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants