user310291
user310291

Reputation: 38228

Can call headless from cmd but not from powershell

In dos when I paste this command it works:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" https://google.com --screenshot=c:\test\google.png --headless --hide-scrollbars --window-size=1920,1080 --disable-gpu &

When I do the same in Powershell it doesn't. I guess my syntax not right ?

Upvotes: 2

Views: 2521

Answers (1)

Paxz
Paxz

Reputation: 3046

You have to use Start-Process in Powershell and parse the Arguments:

Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -ArgumentList "https://google.com","--screenshot=c:\test\google.png","--headless","--hide-scrollbars","--window-size=1920,1080","--disable-gpu"

Upvotes: 5

Related Questions