Files
winutil/functions/public/Invoke-ScratchDialog.ps1
T

29 lines
706 B
PowerShell
Raw Normal View History

+2
2024-02-02 16:22:08 -06:00
function Invoke-ScratchDialog {
<#
.SYNOPSIS
Enable Editable Text box Alternate Scartch path
.PARAMETER Button
#>
$sync.WPFMicrowinISOScratchDir.IsChecked
+2
2024-02-02 16:22:08 -06:00
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$Dialog = New-Object System.Windows.Forms.FolderBrowserDialog
$Dialog.SelectedPath = $sync.MicrowinScratchDirBox.Text
$Dialog.ShowDialog()
+2
2024-02-02 16:22:08 -06:00
$filePath = $Dialog.SelectedPath
Write-Host "No ISO is chosen+ $filePath"
if ([string]::IsNullOrEmpty($filePath)) {
+2
2024-02-02 16:22:08 -06:00
Write-Host "No Folder had chosen"
return
}
+2
2024-02-02 16:22:08 -06:00
$sync.MicrowinScratchDirBox.Text = Join-Path $filePath "\"
}