Hi guys,
Newbie here.
I am trying to make a dialog which enables the user to select a folder, which will be used later in the script as a source for copying some files.
When I start the script, nothing happens, and the PowerShell command shell windows hangs.
What am I doing wrong?
Newbie here.
I am trying to make a dialog which enables the user to select a folder, which will be used later in the script as a source for copying some files.
When I start the script, nothing happens, and the PowerShell command shell windows hangs.
What am I doing wrong?
Code:
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
#This function asks for the location of the build folder
function buildfolderloc {
$foldername = new-object System.Windows.Forms.folderbrowserdialog
$foldername.showdialog()
$script:installfoldername = $foldername.SelectedPath
}
buildfolderloc
Write-Host $installfoldername