Set user-agent and cookie headers for 'copy as powershell' command
Set user-agent and cookie headers for 'copy as powershell' command

Updating the _generatePowerShellCommand function in NetworkLogView.ts to
generate a command that can successfully set the user-agent and cookie
headers.

According to the docs for the Invoke-WebRequest PowerShell command, the
-Headers parameter cannot be used to set these headers.

The fix is to create a WebRequestSession session object, populate it
with the user agent and cookie values, and then pass this object to
Invoke-WebRequest using the -WebSession parameter.

I've verified that the new command output works as expected and that a
test server will see the correct request headers.

Bug: 932971
Change-Id: Id5441137a311b223fcfab48bbd2075598a2879e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2910443
Commit-Queue: Brandon Walderman <5d029aa09a451e20f81a28513ba454595225585f@microsoft.com>
Reviewed-by: John Emau <c153e6e600be23fb28cec0b08551440e4bf7575d@microsoft.com>
Reviewed-by: Sigurd Schneider <f04d242e109628a27a0f75fd49a87722bcf291fd@chromium.org>
Reviewed-by: Jose Leal <49360abdd51ad00da751c3d448c2dbea47853f27@microsoft.com>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend