Skip to content

Commit a7e9bd2

Browse files
author
Maddie Clayton
authored
Merge pull request #7320 from maddieclayton/updatemappings
Make alias mapping more simple
2 parents e305100 + ca99a4c commit a7e9bd2

File tree

7 files changed

+2425
-2395
lines changed

7 files changed

+2425
-2395
lines changed

build.proj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@
257257
<!-- Investigate why the ChangeLogCheck target removes the 8080th character -->
258258
<!-- <CallTarget targets="ChangeLogCheck" ContinueOnError="false" /> -->
259259

260+
<Exec Command="$(PowerShellCommandPrefix) &quot;$ProgressPreference = 'SilentlyContinue';. $(LibraryToolsFolder)\CreateAliasMapping.ps1 &quot;"/>
261+
260262
<MakeDir Directories="$(PackageDirectory)"
261263
Condition="'$(Scope)' != 'Stack'" />
262264
<MakeDir Directories="$(StackPackageFolder)"

documentation/development-docs/create-alias-mappings.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.cs

Lines changed: 17 additions & 2382 deletions
Large diffs are not rendered by default.

src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.json

Lines changed: 2399 additions & 0 deletions
Large diffs are not rendered by default.

src/ResourceManager/Profile/Commands.Profile/Commands.Profile.Netcore.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
<Content Include="*.Netcore.psd1" CopyToOutputDirectory="PreserveNewest" />
8787
<Content Include="*.psm1" CopyToOutputDirectory="PreserveNewest" />
8888
</ItemGroup>
89+
90+
<ItemGroup>
91+
<EmbeddedResource Include="AzureRmAlias\Mappings.json" />
92+
</ItemGroup>
8993

9094
<Target Name="CopyFiles" AfterTargets="Build">
9195
<Copy SourceFiles="@(PreLoadAssemblies)" DestinationFolder="$(TargetDir)\PreloadAssemblies" />

tools/AliasMapping.json

-436 KB
Binary file not shown.

tools/CreateAliasMapping.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$mapping = @{}
1+
$mapping = [ordered]@{}
22

33
$psd1s = Get-ChildItem -Path $PSScriptRoot/../src -Recurse | `
44
Where-Object {($_.Name -like "*AzureRM*psd1" -or $_.Name -eq "Azure.AnalysisServices.psd1" -or $_.Name -eq "Azure.Storage.psd1") `
@@ -8,7 +8,7 @@ $psd1s | ForEach-Object {
88
$name = (($_.Name -replace "AzureRM", "Az") -replace "Azure", "Az") -replace ".psd1", ""
99
if (!($mapping.Contains($name)))
1010
{
11-
$mapping.Add($name, @{})
11+
$mapping.Add($name, [ordered]@{})
1212
}
1313
Import-LocalizedData -BindingVariable psd1info -BaseDirectory $_.DirectoryName -FileName $_.Name
1414
$psd1info.CmdletsToExport | ForEach-Object {
@@ -40,5 +40,4 @@ $psd1s | ForEach-Object {
4040
}
4141
}
4242

43-
$json = ConvertTo-Json $mapping
44-
$json -replace "`"", "`'" | Out-File $PSScriptRoot/AliasMapping.json
43+
ConvertTo-Json $mapping | Set-Content -Path $PSScriptRoot/../src/ResourceManager/Profile/Commands.Profile/AzureRmAlias/Mappings.json

0 commit comments

Comments
 (0)