I'm using Selenium with PowerShell to launch a dashboard display in Internet Explorer on a large monitor in the office. I initiate it like so:
$seleniumOptions = New-Object OpenQA.Selenium.IE.InternetExplorerOptions
$seleniumOptions.BrowserCommandLineArguments = "-k"
$seleniumDriver = New-Object OpenQA.Selenium.IE.InternetExplorerDriver($seleniumOptions)
It all works great. However when it launches an instance of IEDriverServer.exe you see a black console window with debug output. Is there a way to hide this black console window from view?
Thanks.
UPDATE - with a little help from this, mklement0 and JimEvans I've managed to cobble this together and it appears to work - thanks all:
Either (pre-PowerShell 5)
New-Variable -Name IEDS -Value ([OpenQA.Selenium.IE.InternetExplorerDriverService])
$defaultservice = $IEDS::CreateDefaultService()
Or (PowerShell 5)
$defaultservice = [OpenQA.Selenium.IE.InternetExplorerDriverService]::CreateDefaultService()
and then
$defaultservice.HideCommandPromptWindow = $true;
and finally
$seleniumDriver = New-Object OpenQA.Selenium.IE.InternetExplorerDriver -ArgumentList @($defaultservice, $seleniumOptions)