Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Supress warnings on module import via JEA

$
0
0

Has anyone ever come across the issue of supressing error and warning output from module import in a jea endpoint where the module is loaded via role capability/session configuration, rather than in a startup script?

Today i had to temporarily comment out a bunch of functions in order to get solarwinds to be able to parse the output… couldnt believe my eyes at what their convention is for parsable output….

write-host "some.uniqueid: ",$someValue 

As a result of that… any error or warning text that cant be supressed from the host makes it fail parsing the results.

Because the module is imported in jea session setup, i can not explicitly pass it the disablenamechecking switch.

I have tried manually connecting to the jea endpoint and importing the session with no luck.

I have also tried exporting the pssession and importing the resulting module with the disabkenamechecking switch as well. But because the warnings are happenning when jea imports the underlying module, and not when i import the jea session, its of no help.

Long term i will be dealing with the warnings and errors, but for the sake of development, i just want to supress all warnings and errors.

I have set the $erroractionpreference and $warningactionpreference as well, to no avail.

I have tried redirecting the streams to $null… pretty much everything i can think of… even wrapping in an iife and grabbing the streams that way… but hecause its all funnelled to stdout before i can get to supress it or redirect it… no luck.

I cant be the only person that has come up against this.

Please help, you’re my only hope!

submitted by /u/chreestopher2
[link] [comments]

The post Supress warnings on module import via JEA appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles