У меня проблемы с открытием удаленного URL внутри этой формы Power-Shell. URL отлично работает вне скрипта power-shell. Я могу запустить его на IE Firefox или Chrome без проблем. Тем не менее, внутри формы, он немедленно выдает java -скриптовые ошибки.
cls
function GenerateForm {
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.drawing
#Form Setup
$form1 = New-Object System.Windows.Forms.Form
$TabControl = New-object System.Windows.Forms.TabControl
$AlertsPage = New-Object System.Windows.Forms.TabPage
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
#Form Parameter
$form1.Text = "Computer User Preferences and Utilities"
$form1.Name = "form1"
$form1.DataBindings.DefaultDataSourceUpdateMode = 0
$form1.BackColor = "#f5f2d0"
$form1.DataBindings.DefaultDataSourceUpdateMode = 0
$form1.StartPosition = "CenterScreen"
$Form1.ShowInTaskbar = $Formalse
$Form1.FormBorderStyle = "FixedDialog"
$Form1.MaximizeBox = $Formalse
$Form1.MinimizeBox = $Formalse
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 775
$System_Drawing_Size.Height = 490
$form1.ClientSize = $System_Drawing_Size
#Tab Control
$tabControl.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 30
$System_Drawing_Point.Y = 25
$tabControl.Location = $System_Drawing_Point
$tabControl.Name = "tabControl"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Height = 450
$System_Drawing_Size.Width = 725
$tabControl.Size = $System_Drawing_Size
$form1.Controls.Add($tabControl)
$AlertsPage.DataBindings.DefaultDataSourceUpdateMode = 0
$AlertsPage.UseVisualStyleBackColor = $True
$AlertsPage.Name = "AlertPage"
$AlertsPage.Text = "Alerts”
$tabControl.Controls.Add($AlertsPage)
[System.Windows.Forms.Application]::EnableVisualStyles()
$webBrowser1 = New-Object System.Windows.Forms.WebBrowser
#$webBrowser1.ScriptErrorsSuppressed = $true;
#$webBrowser1 = New-Object -ComObject 'internetExplorer.Application'
$webBrowser1.Location = New-Object System.Drawing.Size(0,0)
$webBrowser1.Size = New-Object System.Drawing.Size(710,700)
$webBrowser1.URL="http://www2.lv.psu.edu/it/rss/default.html"
$AlertsPage.Controls.Add($webBrowser1)
#Save the initial state of the form
#Init the OnLoad event to correct the initial state of the form
#Show the Form
$form1.ShowDialog()| Out-Null
} #End Function
GenerateForm