@@ -11,7 +11,7 @@ This module handles the WPF UI
1111
1212function Get-ModuleVersion
1313{
14- ' 3.9.5 '
14+ ' 3.9.6 '
1515}
1616
1717function Initialize-Window
@@ -1535,7 +1535,7 @@ function Add-RegKeyToSettings
15351535
15361536 try
15371537 {
1538- $keyObj = Get-Item - Path $regKey
1538+ $keyObj = Get-Item - Path $regKey - ErrorAction SilentlyContinue
15391539 foreach ($keyValue in ($keyObj.GetValueNames () | Sort))
15401540 {
15411541 try
@@ -2463,6 +2463,7 @@ function Get-MainWindow
24632463
24642464 Add-XamlEvent $script :welcomeForm " gitHubLink" " Add_RequestNavigate" ({ [System.Diagnostics.Process ]::Start($_.Uri.AbsoluteUri ); $_.Handled = $true })
24652465 Add-XamlEvent $script :welcomeForm " licenseLink" " Add_RequestNavigate" ({ [System.Diagnostics.Process ]::Start($_.Uri.AbsoluteUri ); $_.Handled = $true })
2466+ Add-XamlEvent $script :welcomeForm " addCustomApp" " Add_RequestNavigate" ({ [System.Diagnostics.Process ]::Start($_.Uri.AbsoluteUri ); $_.Handled = $true })
24662467
24672468 Add-XamlEvent $script :welcomeForm " chkAcceptConditions" " add_click" {
24682469 $global :btnAcceptConditions.IsEnabled = ($this.IsChecked -eq $true )
@@ -2471,6 +2472,7 @@ function Get-MainWindow
24712472 Add-XamlEvent $script :welcomeForm " btnAcceptConditions" " add_click" {
24722473 Save-Setting " " " LicenseAccepted" " True"
24732474 Save-Setting " " " FirstTimeRunning" " False"
2475+ Save-Setting " " " AppChangeInformed" " true"
24742476 Show-ModalObject
24752477
24762478 if ($global :currentViewObject.ViewInfo.Authentication.ShowErrors )
@@ -2484,12 +2486,41 @@ function Get-MainWindow
24842486 {
24852487 $window.Close ()
24862488 }
2487- }
2489+ }
24882490
2489- Show-ModalForm $window.Title $script :welcomeForm - HideButtons
2491+ Show-ModalForm $window.Title $script :welcomeForm - HideButtons
24902492 }
24912493 else
24922494 {
2495+ if ($global :informOldAzureApp -eq $true )
2496+ {
2497+ $appIdChangeInformed = Get-Setting " " " AppChangeInformed" " false"
2498+ if ($appIdChangeInformed -ne " true" ) {
2499+ $script :oldAzureAppForm = Get-XamlObject ($global :AppRootFolder + " \Xaml\OldAzureApp.xaml" )
2500+
2501+ Add-XamlEvent $script :oldAzureAppForm " addCustomApp" " Add_RequestNavigate" ({ [System.Diagnostics.Process ]::Start($_.Uri.AbsoluteUri ); $_.Handled = $true })
2502+
2503+ Add-XamlEvent $script :oldAzureAppForm " btnOK" " add_click" {
2504+ if ((Get-XamlProperty $script :oldAzureAppForm " chkChangeApp" " IsChecked" ) -eq $true ) {
2505+ Write-Log " Set default app ID to $ ( $global :DefaultAzureApp ) "
2506+ Save-Setting " EndpointManager" " EMAzureApp" $global :DefaultAzureApp
2507+ $script :azureAppChanged = $true
2508+ }
2509+
2510+ if ((Get-XamlProperty $script :oldAzureAppForm " chkSkippMessage" " IsChecked" ) -eq $true ) {
2511+ Save-Setting " " " AppChangeInformed" " true"
2512+ }
2513+ Show-ModalObject
2514+ if ($script :azureAppChanged -eq $true -and $global :currentViewObject ) {
2515+ [System.Windows.Forms.Application ]::DoEvents()
2516+ & $global :currentViewObject.ViewInfo.Authenticate
2517+ }
2518+ }
2519+
2520+ Show-ModalForm $window.Title $script :oldAzureAppForm - HideButtons
2521+ }
2522+ }
2523+
24932524 # ##!!! Force login here
24942525 if ($global :currentViewObject.ViewInfo.Authenticate )
24952526 {
0 commit comments