I am trying to create a GUI page with powershell. The script works fine with powershell version 4.0 . But it throws exception when tried to execute it in poweshell version 3.0
$return = button "Enter Parameters" "Enter Domain" "Enter User" "Enter Server" 
function button ($title,$domain, $user, $Server) { 
[void][System.Reflection.Assembly]::LoadWithPartialName( "System.Windows.Forms")  
[void][System.Reflection.Assembly]::LoadWithPartialName( "Microsoft.VisualBasic")  
$form = New-Object "System.Windows.Forms.Form"; 
$form.Width = 500; 
$form.Height = 150; 
$form.Text = $title; 
$form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen; 
$textLabel1 = New-Object "System.Windows.Forms.Label"; 
$textLabel1.Left = 25; 
$textLabel1.Top = 15; 
Exception:
At C:\Users\rights.ps1:16 char:35
+ [void][System.Reflection.Assembly]LoadWithPartialName( System.Windows.Forms)
+                                   ~~~~~~~~~~~~~~~~~~~
Unexpected token 'LoadWithPartialName' in expression or statement.
At C:\Users\rights.ps1:17 char:35
+ [void][System.Reflection.Assembly]LoadWithPartialName( Microsoft.VisualBasic)
+                                   ~~~~~~~~~~~~~~~~~~~
Unexpected token 'LoadWithPartialName' in expression or statement.
At C:\Users\rights.ps1:23 char:67
+     $form.StartPosition = [System.Windows.Forms.FormStartPosition]CenterScreen;
+                                                                   ~~~~~~~~~~~~
Can someone please help me the solve this.
 
     
    