Changed User Agent to be 2.0 compatible

1.6
rvrsh3ll 2015-11-23 15:40:45 -05:00
parent c2c1676eea
commit abb1c7f555
1 changed files with 10 additions and 12 deletions

View File

@ -249,20 +249,18 @@ param (
}
function Get-UserAgent {
# Uses PowerShell's prebuilt UA strings. See
# http://goo.gl/9IGloI
[CmdletBinding()]
param (
[string]$browsertype
)
if (!$browsertype) {
$browsers = @('Firefox','Chrome','InternetExplorer','Opera','Safari')
$browsertype = Get-Random -InputObject $browsers
}
$UAString = @('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1)',
'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0',
'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko',
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 7.0; InfoPath.3; .NET CLR 3.1.40767; Trident/6.0; en-IN)',
'Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16',
'Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2',
'Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20121202 Firefox/17.0 Iceweasel/17.0.1')
$script:UserAgent = [Microsoft.PowerShell.Commands.PSUserAgent]::$browsertype
$script:UserAgent = Get-Random -Input $UAString
}