This is an issue I have been having for some time and I have just not been able to find any solution to it.
Often times I have a PowerShell advanced function/ simple function that is using a native command internally. I want the function to have a seamless PowerShell experience, and I mostly achieved this except for whatever messages the cli might decide to print. Cli tools have “quite” options, so I use that when I can but some dont have it.
For example calibre-convert has a -verbose
flag but its only used to increase the number of output messages. The tool essentially does not have an option to turn of its messages.
I have tried a variety of things in PowerShell to get around this issue. For example, running either of the following lines always prints the following output:
calibre-convert inputBook.epub outputBook.pdf |out-null
$dump = calibre-convert inputBook.epub outputBook.pdf
The output:
qt.webenginecontext:
qt.webenginecontext:
GL Type: disabled
Surface Type: OpenGL
Surface Profile: NoProfile
Surface Version: 3.0
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: yes
Using Multithreaded OpenGL: no
Init Parameters:
* application-name ebook-convert
* browser-subprocess-path C:Program FilesCalibre2appbinQtWebEngineProcess.exe
* disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture
* disable-gpu
* disable-speech-api
* enable-features NetworkServiceInProcess,TracingServiceInProcess
* enable-threaded-compositing
* in-process-gpu
* use-gl disabled
Of course these messages have a purpose, I use them when I am writting my function, I just dont need them when in actual use as intend to do my own error handling.
powershell 7.4