Created
June 4, 2019 15:16
-
-
Save matt40k/7102471fa22fa734c0940c73b964ba2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$chromeExe = '"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"' | |
$outputDir = "C:\Temp\" | |
function GetScreenshot($fileName, $url) | |
{ | |
$command = @' | |
cmd.exe /C $chromeExe --headless --disable-gpu --screenshot="$outputDir\$fileName.png" --window-size=1920,1024 $url | |
'@ | |
Invoke-Expression -Command:$command | |
} | |
GetScreenshot -fileName "test" -url "https://matt40k.co.uk" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment