|
Hi All,
I have a piece of code pasted below, all i am doing is converting my powershell script to EXE using PSCX. But when i try to double click that file i get a message saying that .exe is failed, "Close the program or Debug the program"
Can someone help me what possibly could i be doing wrong?
+++++++++++++++++++++++++++++++++++++++++++++++++++++
Add-PSSnapin Microsoft.SharePoint.PowerShell
function Invoke-FileBrowser
{
[System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
$FileBrowser.InitialDirectory = "C:\"
$FileBrowser.Filter = "All Files (*.*)| *.*"
$FileBrowser.Title = "Browse"
$FileBrowser.ShowHelp = $true
$Show = $FileBrowser.ShowDialog()
}
Invoke-FileBrowser
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|