Skip to content

Commit f4463d4

Browse files
author
maddieclayton
committed
fix directory
1 parent 7e74d5c commit f4463d4

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@
1616
using System;
1717
using System.Collections.Generic;
1818
using System.IO;
19+
using System.Reflection;
1920

2021
namespace Microsoft.Azure.Commands.Profile.AzureRmAlias
2122
{
2223
public class Mappings
2324
{
2425
public static Dictionary<string, object> GetCaseInsensitiveMapping()
2526
{
26-
using (StreamReader r = new StreamReader(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) +
27-
Path.DirectorySeparatorChar + "AzureRmAlias" + Path.DirectorySeparatorChar + "Mappings.json"))
27+
var assembly = Assembly.GetExecutingAssembly();
28+
var resourceName = "Microsoft.Azure.Commands.Profile.AzureRmAlias.Mappings.json";
29+
30+
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
31+
using (StreamReader reader = new StreamReader(stream))
2832
{
29-
Dictionary<string, object> caseSensitiveMapping = (Dictionary<string, object>)JsonConvert.DeserializeObject(r.ReadToEnd(), typeof(Dictionary<string, object>));
33+
Dictionary<string, object> caseSensitiveMapping = (Dictionary<string, object>)JsonConvert.DeserializeObject(reader.ReadToEnd(), typeof(Dictionary<string, object>));
3034
var mapping = new Dictionary<string, object>(StringComparer.CurrentCultureIgnoreCase);
3135
foreach (var key in caseSensitiveMapping.Keys)
3236
{
@@ -37,4 +41,4 @@ public static Dictionary<string, object> GetCaseInsensitiveMapping()
3741
}
3842
}
3943
}
40-
}
44+
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,12 @@
14681468
"Set-AzServiceEndpointPolicyDefinition": "Set-AzureRmServiceEndpointPolicyDefinition",
14691469
"Add-AzServiceEndpointPolicyDefinition": "Add-AzureRmServiceEndpointPolicyDefinition",
14701470
"Set-AzServiceEndpointPolicy": "Set-AzureRmServiceEndpointPolicy",
1471+
"Get-AzNetworkProfile": "Get-AzureRmNetworkProfile",
1472+
"New-AzNetworkProfile": "New-AzureRmNetworkProfile",
1473+
"Remove-AzNetworkProfile": "Remove-AzureRmNetworkProfile",
1474+
"Set-AzNetworkProfile": "Set-AzureRmNetworkProfile",
1475+
"New-AzContainerNicConfig": "New-AzureRmContainerNicConfig",
1476+
"New-AzContainerNicConfigIpConfig": "New-AzureRmContainerNicConfigIpConfig",
14711477
"New-AzVirtualWan": "New-AzureRmVirtualWan",
14721478
"Update-AzVirtualWan": "Update-AzureRmVirtualWan",
14731479
"Get-AzVirtualWan": "Get-AzureRmVirtualWan",
@@ -1505,6 +1511,15 @@
15051511
"New-AzFirewallNetworkRuleCollection": "New-AzureRmFirewallNetworkRuleCollection",
15061512
"New-AzFirewallNetworkRule": "New-AzureRmFirewallNetworkRule",
15071513
"Get-AzInterfaceEndpoint": "Get-AzureRmInterfaceEndpoint",
1514+
"Add-AzNetworkInterfaceTapConfig": "Add-AzureRmNetworkInterfaceTapConfig",
1515+
"Get-AzNetworkInterfaceTapConfig": "Get-AzureRmNetworkInterfaceTapConfig",
1516+
"Set-AzNetworkInterfaceTapConfig": "Set-AzureRmNetworkInterfaceTapConfig",
1517+
"New-AzNetworkInterfaceTapConfig": "New-AzureRmNetworkInterfaceTapConfig",
1518+
"Remove-AzNetworkInterfaceTapConfig": "Remove-AzureRmNetworkInterfaceTapConfig",
1519+
"Get-AzVirtualNetworkTap": "Get-AzureRmVirtualNetworkTap",
1520+
"New-AzVirtualNetworkTap": "New-AzureRmVirtualNetworkTap",
1521+
"Remove-AzVirtualNetworkTap": "Remove-AzureRmVirtualNetworkTap",
1522+
"Set-AzVirtualNetworkTap": "Set-AzureRmVirtualNetworkTap",
15081523
"List-AzApplicationGatewayAvailableWafRuleSets": "List-AzureRmApplicationGatewayAvailableWafRuleSets",
15091524
"List-AzApplicationGatewayAvailableSslOptions": "List-AzureRmApplicationGatewayAvailableSslOptions",
15101525
"List-AzApplicationGatewaySslPredefinedPolicy": "List-AzureRmApplicationGatewaySslPredefinedPolicy"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
</ItemGroup>
6161

6262
<ItemGroup>
63-
<None Update="AzureRmAlias\Mappings.json">
64-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
65-
</None>
6663
<None Update="AzureRmProfileStartup.ps1">
6764
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6865
</None>
@@ -80,7 +77,10 @@
8077
<Content Include="*.ps1" CopyToOutputDirectory="PreserveNewest" />
8178
<Content Include="*.Netcore.psd1" CopyToOutputDirectory="PreserveNewest" />
8279
<Content Include="*.psm1" CopyToOutputDirectory="PreserveNewest" />
83-
<Content Include="*.json" CopyToOutputDirectory="PreserveNewest" />
80+
</ItemGroup>
81+
82+
<ItemGroup>
83+
<EmbeddedResource Include="AzureRmAlias\Mappings.json" />
8484
</ItemGroup>
8585

8686
<Target Name="CopyFiles" AfterTargets="Build">

0 commit comments

Comments
 (0)