From 73bdb7087a47f70db3c1cf4043cbb6f728929fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B6tz=20Jensen?= Date: Tue, 3 Feb 2026 12:58:20 +0100 Subject: [PATCH] Fix: Tepp didn't work the way i believed.... --- .../internal/configurations/configuration.ps1 | 23 ++++++++++++++- d365bap.tools/internal/tepp/assignment.ps1 | 3 +- .../internal/tepp/configurations.tepp.ps1 | 29 +++++-------------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/d365bap.tools/internal/configurations/configuration.ps1 b/d365bap.tools/internal/configurations/configuration.ps1 index f0373f7..0ac3b55 100644 --- a/d365bap.tools/internal/configurations/configuration.ps1 +++ b/d365bap.tools/internal/configurations/configuration.ps1 @@ -18,4 +18,25 @@ Set-PSFConfig -FullName "d365bap.tools.tenant.details" -Value @{} -Initialize -D Set-PSFConfig -FullName "d365bap.tools.path.azcopy" -Value "C:\temp\d365bap.tools\AzCopy\AzCopy.exe" -Initialize -Description "Path to the default location where AzCopy.exe is located." -Set-PSFConfig -FullName "d365bap.tools.ude.dbjit.cache" -Value @{} -Initialize -Description "Object that stores different Ude Database JIT credentials and their details." \ No newline at end of file +Set-PSFConfig -FullName "d365bap.tools.ude.dbjit.cache" -Value @{} -Initialize -Description "Object that stores different Ude Database JIT credentials and their details." + +Set-PSFConfig -FullName "d365bap.tools.bap.deploy.locations" -Value @{ + "UnitedStates" = @("EastUS", "WestUS", "EastUS2", "CentralUS") + "UnitedStatesFirstRelease" = @("EastUS", "WestUS", "EastUS2", "CentralUS") + "Europe" = @("WestEurope", "NorthEurope") + "Asia" = @("EastAsia", "SoutheastAsia") + "Australia" = @("AustraliaEast", "AustraliaSoutheast") + "India" = @("CentralIndia", "SouthIndia") + "Japan" = @("JapanEast", "JapanWest") + "Canada" = @("CanadaCentral", "CanadaEast") + "UnitedKingdom" = @("UKSouth", "UKWest") + "SouthAmerica" = @("BrazilSouth") + "France" = @("FranceCentral", "FranceSouth") + "UnitedArabEmirates" = @("UAENorth") + "Germany" = @("GermanyNorth", "GermanyWestCentral") + "Switzerland" = @("SwitzerlandNorth", "SwitzerlandWest") + "Norway" = @("NorwayEast", "NorwayWest") + "Korea" = @("KoreaCentral", "KoreaSouth") + "SouthAfrica" = @("SouthAfricaNorth") + "Sweden" = @("SwedenCentral") +} -Initialize -Description "Object that stores different BAP deploy locations and their details." \ No newline at end of file diff --git a/d365bap.tools/internal/tepp/assignment.ps1 b/d365bap.tools/internal/tepp/assignment.ps1 index 3b14da8..2400a1c 100644 --- a/d365bap.tools/internal/tepp/assignment.ps1 +++ b/d365bap.tools/internal/tepp/assignment.ps1 @@ -13,7 +13,6 @@ Register-PSFTeppArgumentCompleter -Command Start-UdeDbSsms -Parameter Id -Name " Register-PSFTeppArgumentCompleter -Command Get-BapDeployLocation -Parameter Name -Name "d365bap.tools.tepp.bap.locations" Register-PSFTeppArgumentCompleter -Command Get-BapDeployTemplate -Parameter Location -Name "d365bap.tools.tepp.bap.locations" -Register-PSFTeppArgumentCompleter -Command Get-BapDeployParameter -Parameter Location -Name "d365bap.tools.tepp.bap.locations" Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter Location -Name "d365bap.tools.tepp.bap.locations" Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter Region -Name "d365bap.tools.tepp.bap.regions" @@ -21,4 +20,4 @@ Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter FnoTemp Register-PSFTeppArgumentCompleter -Command New-UseEnvironment -Parameter Location -Name "d365bap.tools.tepp.bap.locations" Register-PSFTeppArgumentCompleter -Command New-UseEnvironment -Parameter Region -Name "d365bap.tools.tepp.bap.regions" -Register-PSFTeppArgumentCompleter -Command New-UdeEnvironment -Parameter FnoTemplate -Name "d365bap.tools.tepp.bap.templates" +Register-PSFTeppArgumentCompleter -Command New-UseEnvironment -Parameter FnoTemplate -Name "d365bap.tools.tepp.bap.templates" diff --git a/d365bap.tools/internal/tepp/configurations.tepp.ps1 b/d365bap.tools/internal/tepp/configurations.tepp.ps1 index f31be18..ae69d2e 100644 --- a/d365bap.tools/internal/tepp/configurations.tepp.ps1 +++ b/d365bap.tools/internal/tepp/configurations.tepp.ps1 @@ -6,27 +6,6 @@ $scriptBlock = { Get-UdeDbJitCache | Sort-Object Id | Select-Object -ExpandPrope Register-PSFTeppScriptblock -Name "d365bap.tools.tepp.ude.dbjit.credentials" -ScriptBlock $scriptBlock -Mode Simple -$azureRegions = @{ - "UnitedStates" = @("EastUS", "WestUS", "EastUS2", "CentralUS") - "UnitedStatesFirstRelease" = @("EastUS", "WestUS", "EastUS2", "CentralUS") - "Europe" = @("WestEurope", "NorthEurope") - "Asia" = @("EastAsia", "SoutheastAsia") - "Australia" = @("AustraliaEast", "AustraliaSoutheast") - "India" = @("CentralIndia", "SouthIndia") - "Japan" = @("JapanEast", "JapanWest") - "Canada" = @("CanadaCentral", "CanadaEast") - "UnitedKingdom" = @("UKSouth", "UKWest") - "SouthAmerica" = @("BrazilSouth") - "France" = @("FranceCentral", "FranceSouth") - "UnitedArabEmirates" = @("UAENorth") - "Germany" = @("GermanyNorth", "GermanyWestCentral") - "Switzerland" = @("SwitzerlandNorth", "SwitzerlandWest") - "Norway" = @("NorwayEast", "NorwayWest") - "Korea" = @("KoreaCentral", "KoreaSouth") - "SouthAfrica" = @("SouthAfricaNorth") - "Sweden" = @("SwedenCentral") -} - $scriptBlock = { param ( $commandName, @@ -44,6 +23,8 @@ $scriptBlock = { return } + $azureRegions = Get-PSFConfigValue -FullName "d365bap.tools.bap.deploy.locations" + # Filter items based on the location and what the user has typed $filteredItems = $azureRegions[$location] | Where-Object { $_ -like "$wordToComplete*" } | Sort-Object @@ -55,7 +36,11 @@ $scriptBlock = { Register-PSFTeppScriptblock -Name "d365bap.tools.tepp.bap.regions" -ScriptBlock $scriptBlock -Mode Full -$scriptBlock = { @($azureRegions.Keys | Sort-Object) } +$scriptBlock = { + $azureRegions = Get-PSFConfigValue -FullName "d365bap.tools.bap.deploy.locations" + + @($azureRegions.Keys | Sort-Object) +} Register-PSFTeppScriptblock -Name "d365bap.tools.tepp.bap.locations" -ScriptBlock $scriptBlock -Mode Simple