Hi LucD,
I used the code you provided, but it's still putting the files in a folder called OK on my desktop even though I provided a network share. Any idea why that's happening?
$PickFolder = New-Object -TypeName System.Windows.Forms.OpenFileDialog
$PickFolder.FileName = 'dummy'
$PickFolder.Filter = 'Folder Selection|*.*'
$PickFolder.AddExtension = $false
$PickFolder.CheckFileExists = $false
$PickFolder.Multiselect = $false
$PickFolder.CheckPathExists = $true
$PickFolder.ShowReadOnly = $false
$PickFolder.ReadOnlyChecked = $true
$PickFolder.ValidateNames = $false
$result = $PickFolder.ShowDialog()
if($result -eq [System.Windows.Forms.DialogResult]::OK) {
Write-Host "Selected Location:" -ForegroundColor Green
$PickFolder.FileName
}
else {Write-Host "File Save Dialog Canceled" -ForegroundColor Yellow
&$commands
}
What's also interesting is if I hit cancel it will still attempt to export the OVF onto my desktop in a folder called cancel. Something is seriously messed up here, but I'm not sure what.