I am simply trying to code something that can either launch the Chrome browser to the "about" page; or open a tab with the "about" page, that will run in PowerShell.
I have tried the following, and it only results in chrome opening for a short second, and then closing...
`
Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList '"chrome://about"'
`
This works with any HTTP/S: location, but I think it doesn't like the 'Chrome:' tag.
... Any ideas?
CodePudding user response:
It's because that landing page/tab is not a legit URL. So you can do this (though well, you know, SendKeys ...).
Add-Type -AssemblyName System.Windows.Forms
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe'
Start-Sleep -Milliseconds 300
[System.Windows.Forms.SendKeys]::SendWait('chrome://about{Enter}')