diff --git a/functions/public/Invoke-WPFUIElements.ps1 b/functions/public/Invoke-WPFUIElements.ps1 index 2946f688..2ec3f2bd 100644 --- a/functions/public/Invoke-WPFUIElements.ps1 +++ b/functions/public/Invoke-WPFUIElements.ps1 @@ -35,6 +35,8 @@ function Invoke-WPFUIElements { if (!$borderstyle -or !$HoverTextBlockStyle -or !$ColorfulToggleSwitchStyle) { throw "Failed to retrieve Styles using 'FindResource' from main window element." } + + $targetGrid = $window.FindName($targetGridName) if (!$targetGrid) { throw "Failed to retrieve Target Grid by name, provided name: $targetGrid"