From ebcfa4f9dcac8b65c81de41f0c2a9071041b938f Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT Date: Fri, 7 Feb 2025 17:05:48 -0800 Subject: [PATCH] Tooltips --- FFUDevelopment/BuildFFUVM_UI.ps1 | 10 ++ FFUDevelopment/BuildFFUVM_UI.xaml | 169 +++++++++++++++++------------- 2 files changed, 106 insertions(+), 73 deletions(-) diff --git a/FFUDevelopment/BuildFFUVM_UI.ps1 b/FFUDevelopment/BuildFFUVM_UI.ps1 index 718fb70..40f6abe 100644 --- a/FFUDevelopment/BuildFFUVM_UI.ps1 +++ b/FFUDevelopment/BuildFFUVM_UI.ps1 @@ -18,6 +18,7 @@ $defaultWindowsSKU = "Pro" $defaultMediaType = "Consumer" # updated value $defaultOptionalFeatures = "" $defaultProductKey = "" +$defaultFFUPrefix = "_FFU" # <-- new default for VM Name Prefix # Large list from the ValidateSet in BuildFFUVM.ps1 ($OptionalFeatures parameter) $allowedFeatures = @( @@ -138,6 +139,9 @@ function Get-UIConfig { $logicalSectorObj = $window.FindName('cmbLogicalSectorSize').SelectedItem $logicalSectorSize = [int]$logicalSectorObj.Content + # <-- NEW: retrieve FFUPrefix from the new textbox (VM Name Prefix) + $ffuPrefix = $window.FindName('txtVMNamePrefix').Text + # --- Windows Settings tab --- $wrItem = $window.FindName('cmbWindowsRelease').SelectedItem $windowsRelease = if ($wrItem -and $wrItem.Value) { [int]$wrItem.Value } else { 10 } @@ -198,6 +202,7 @@ function Get-UIConfig { EnablePromptExternalHardDiskMedia = $promptExt FFUCaptureLocation = $ffuCaptureLocation FFUDevelopmentPath = $ffuDevPath + ISOPath = $isoPath # <-- NEW: Add Windows ISO Path to config MediaType = $mediaType Make = $make Model = $model @@ -225,6 +230,7 @@ function Get-UIConfig { WindowsRelease = $windowsRelease WindowsSKU = $windowsSKU WindowsVersion = $windowsVersion + FFUPrefix = $ffuPrefix # <-- new option for VM Name Prefix } # Sort the configuration hashtable alphabetically by key @@ -412,6 +418,8 @@ $window.Add_Loaded({ $window.FindName('txtUsername').Text = "ffu_user" # Set VM Location default to $FFUDevelopmentPath\VM $window.FindName('txtVMLocation').Text = (Join-Path $FFUDevelopmentPath "VM") + # <-- NEW: Set the default for the new VM Name Prefix textbox on the Hyper-V Settings tab + $window.FindName('txtVMNamePrefix').Text = $defaultFFUPrefix # Hyper-V Settings: Populate defaults (Share Name and Username now on Build, so only populate remaining fields) $script:vmSwitchMap = @{} $script:allSwitches = Get-VMSwitch -ErrorAction SilentlyContinue @@ -688,6 +696,8 @@ $btnLoadConfig.Add_Click({ $window.FindName('txtMemory').Text = $configContent.Memory / 1GB $window.FindName('txtProcessors').Text = $configContent.Processors $window.FindName('txtVMLocation').Text = $configContent.VMLocation + # <-- NEW: Update the VM Name Prefix textbox value during config load + $window.FindName('txtVMNamePrefix').Text = $configContent.FFUPrefix $window.FindName('cmbLogicalSectorSize').SelectedItem = $configContent.LogicalSectorSizeBytes # Windows Settings $window.FindName('txtISOPath').Text = $configContent.ISOPath diff --git a/FFUDevelopment/BuildFFUVM_UI.xaml b/FFUDevelopment/BuildFFUVM_UI.xaml index cad41bd..90408b3 100644 --- a/FFUDevelopment/BuildFFUVM_UI.xaml +++ b/FFUDevelopment/BuildFFUVM_UI.xaml @@ -146,8 +146,8 @@ - - + +