Skip to content

Rename sql cmdlets and add aliases #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@
<Component Id="cmpE16AC4B0282EF42385AFF81489538517" Guid="*">
<File Id="fil501BC202C6E7D0F345365C993D0461C1" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmpA911AB5888BFD5D6EB9B2F0226D3F2E2" Guid="*">
<File Id="fil360D674BFE1536E2D6B34C390B87BBAB" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp763A6F92E7A6914C7E6E1D1550081C08" Guid="*">
<File Id="filA98A1959E1D89408C77943B88EDE6754" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Compute\ServiceManagementStartup.ps1" />
</Component>
Expand Down Expand Up @@ -967,6 +970,9 @@
<Component Id="cmp092B990A20E8B0B33D4450EBA12B9AB4" Guid="*">
<File Id="fil4CCFA35C51816A35D00C8371811EDE94" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\KeyVault\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmpBDC491FE3308C98A7A028C55735AF8FD" Guid="*">
<File Id="filE4C00F637B89E3E6198BBFCAF1FA2C0A" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\KeyVault\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp5CDCB0785A318F614D9422554B3F4ED2" Guid="*">
<File Id="fil273B7FB1C198C0F151940A2EAF215BD2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\KeyVault\System.Net.Http.Extensions.dll" />
</Component>
Expand Down Expand Up @@ -1074,6 +1080,9 @@
<Component Id="cmp52954FF14988D0FF1E9D0569B4A8879E" Guid="*">
<File Id="fil594D8C042FC9A997CC2136045E69C3EC" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Network\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmp332BD7FBB67C08CE58DC0BE2A3A24303" Guid="*">
<File Id="fil1AB40AD8B4C2FC59379BD2E5C4B95CB9" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Network\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp3BE0A2D8A9F59780E10334BB032B5561" Guid="*">
<File Id="fil8F8010BFCF5A6371692CCF9ACE05E660" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Network\System.Net.Http.Extensions.dll" />
</Component>
Expand Down Expand Up @@ -1296,6 +1305,9 @@
<Component Id="cmp81ACE07255D539B22EAAE5C07BF9C6B7" Guid="*">
<File Id="fil20BBB718A749C1E485E5AAC0700CB59C" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmpDFC57AA22185F7BE5A0D339D4F355546" Guid="*">
<File Id="filF75685E98A8F3C8E4F5DDEC6E8C70B65" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp5B024A4E29BF400F1ED3DE2CE1F2E0DD" Guid="*">
<File Id="filBDA4AC7C21781E73732383C29552E770" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Resources\System.Net.Http.Extensions.dll" />
</Component>
Expand Down Expand Up @@ -1569,6 +1581,9 @@
<Component Id="cmpEF3E47318D73A7FC3C949888F6CD595D" Guid="*">
<File Id="fil90F4A098BA3CC6997CC5CE037F2F1243" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\StorageManagement\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmp38B55B30C884DF044800357D11B02535" Guid="*">
<File Id="filE10A550ADE144FBFDC60F6BB49DD10C1" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\StorageManagement\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp09AED3D479FDA1BAB8D088446C84BD57" Guid="*">
<File Id="filEC38535F0D1E6C94C3E31A2CF7A39BC9" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\StorageManagement\System.Net.Http.Extensions.dll" />
</Component>
Expand Down Expand Up @@ -2101,6 +2116,9 @@
<Component Id="cmp4AA539549D58FD2D5DD3C404556F3DBB" Guid="*">
<File Id="fil4D8DA0FB6E8B4E47BD5A37E758BFC156" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\PIR.psd1" />
</Component>
<Component Id="cmp59F8D1CCB66016CE9609297EA9DBF30D" Guid="*">
<File Id="fil13D170173EBE365CC4B615CD04B123C7" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp348131C92750A7166DCA75757E409378" Guid="*">
<File Id="fil4C89A8A3AA200315DD08D7FD6DA12286" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Compute\ServiceManagementStartup.ps1" />
</Component>
Expand Down Expand Up @@ -2431,6 +2449,9 @@
<Component Id="cmp095AB0635AB59E44C60473C62E9B6C84" Guid="*">
<File Id="fil33488FAC074F25EED6834D4EBE031E46" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmp361542BC212F1EFD07C4EE7A6496E254" Guid="*">
<File Id="fil00D965BE7829E21453514860BF25A585" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp1D09E2F4BC62197FC8C187ECF16B08D0" Guid="*">
<File Id="fil5ACE44A99790483ADE6DAD2FADE81F2D" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\ManagedCache\ServiceManagementStartup.ps1" />
</Component>
Expand Down Expand Up @@ -3131,6 +3152,9 @@
<Component Id="cmpFA98ECC9A87BB49B7FC68AC0CDC89955" Guid="*">
<File Id="filB9E5BFA2050E0BE989D9A445514B2656" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmp35343F87E4C47BED5F3495E072870B4E" Guid="*">
<File Id="filBDFB3D4CFEEA4082BABD966E01309444" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmpD7030FC24236E343750765385BE1F3CD" Guid="*">
<File Id="fil74ACA8D2F975B318C5B14F4459395805" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Services\ServiceManagementStartup.ps1" />
</Component>
Expand Down Expand Up @@ -3538,6 +3562,9 @@
<Component Id="cmp8839023EABF68726F33F2E22907EE5CA" Guid="*">
<File Id="fil7E09EF4FC96DB53F9DCD865B90E854B6" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\PostBuild.ps1" />
</Component>
<Component Id="cmp91F23AEF11B1513BE8D9605E0197AFD6" Guid="*">
<File Id="filA7E99FCBA6DD0FFF2BF0E74F1E1041BB" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\ResourceManagerStartup.ps1" />
</Component>
<Component Id="cmp0B5A5E6BA5861771073ED88DCAB35DCC" Guid="*">
<File Id="fil7399EB9870646ED4FE533B1842E6CE84" KeyPath="yes" Source="$(var.sourceDir)\ServiceManagement\Azure\Sql\ServiceManagementStartup.ps1" />
</Component>
Expand Down Expand Up @@ -3928,6 +3955,7 @@
<ComponentRef Id="cmpBFCB1E992759555E524E0637A72EE14B" />
<ComponentRef Id="cmp02F11033E68D6FED58954A529B7DC8CC" />
<ComponentRef Id="cmpE16AC4B0282EF42385AFF81489538517" />
<ComponentRef Id="cmpA911AB5888BFD5D6EB9B2F0226D3F2E2" />
<ComponentRef Id="cmp763A6F92E7A6914C7E6E1D1550081C08" />
<ComponentRef Id="cmpC8911F605D0A03E9308F3B6F4C8004B6" />
<ComponentRef Id="cmpDFAA37232FF72FD87A83F2DCC6FA5A82" />
Expand Down Expand Up @@ -4103,6 +4131,7 @@
<ComponentRef Id="cmp6FB7367EB59366676B7060F0FD5FDAC3" />
<ComponentRef Id="cmp1496C1F7B5BF9E8A5598E8126F87355B" />
<ComponentRef Id="cmp092B990A20E8B0B33D4450EBA12B9AB4" />
<ComponentRef Id="cmpBDC491FE3308C98A7A028C55735AF8FD" />
<ComponentRef Id="cmp5CDCB0785A318F614D9422554B3F4ED2" />
<ComponentRef Id="cmpE90D51E3A3C747163C7F1D6DC5409800" />
<ComponentRef Id="cmpAD51B1C903B9CB0DB18004F97CD8ADBA" />
Expand Down Expand Up @@ -4138,6 +4167,7 @@
<ComponentRef Id="cmpBB669B8D821D971CA6F0426E2D30A7DF" />
<ComponentRef Id="cmp7182B595711C42F35606A19E3FA472AB" />
<ComponentRef Id="cmp52954FF14988D0FF1E9D0569B4A8879E" />
<ComponentRef Id="cmp332BD7FBB67C08CE58DC0BE2A3A24303" />
<ComponentRef Id="cmp3BE0A2D8A9F59780E10334BB032B5561" />
<ComponentRef Id="cmpABCB74E74D8A2A86538888C4B07D030B" />
<ComponentRef Id="cmp1F786D1771E02C0007F768794F3E10AB" />
Expand Down Expand Up @@ -4210,6 +4240,7 @@
<ComponentRef Id="cmpF750706356EAB58C8C81ED96B57288C8" />
<ComponentRef Id="cmp607260D321DBB6DC85249332ACCCDF1E" />
<ComponentRef Id="cmp81ACE07255D539B22EAAE5C07BF9C6B7" />
<ComponentRef Id="cmpDFC57AA22185F7BE5A0D339D4F355546" />
<ComponentRef Id="cmp5B024A4E29BF400F1ED3DE2CE1F2E0DD" />
<ComponentRef Id="cmp997A920A652163E94E56A412D2BEC28C" />
<ComponentRef Id="cmp353F25E254A7722E3CADF046790D3C4D" />
Expand Down Expand Up @@ -4299,6 +4330,7 @@
<ComponentRef Id="cmp4EC528690F259ADF968B0C0C9AE4B64E" />
<ComponentRef Id="cmp4F19A7D4965EA52930FACE952EEDDAEC" />
<ComponentRef Id="cmpEF3E47318D73A7FC3C949888F6CD595D" />
<ComponentRef Id="cmp38B55B30C884DF044800357D11B02535" />
<ComponentRef Id="cmp09AED3D479FDA1BAB8D088446C84BD57" />
<ComponentRef Id="cmpA55D0454E5F3FEE0A8CBAF32B3C8062A" />
<ComponentRef Id="cmp26F750578592FC98DB18AAB9B2B5A22A" />
Expand Down Expand Up @@ -4471,6 +4503,7 @@
<ComponentRef Id="cmpA7662EDC9DDCCFD0290DDB9350660A6B" />
<ComponentRef Id="cmp7F9F978DBE7D6715FA75FFB3BE40806E" />
<ComponentRef Id="cmp4AA539549D58FD2D5DD3C404556F3DBB" />
<ComponentRef Id="cmp59F8D1CCB66016CE9609297EA9DBF30D" />
<ComponentRef Id="cmp348131C92750A7166DCA75757E409378" />
<ComponentRef Id="cmp289352966E5E4647DF24D7FFCEA4200F" />
<ComponentRef Id="cmpA497DCDAF4262858EF7BF8F3E4A03F30" />
Expand Down Expand Up @@ -4579,6 +4612,7 @@
<ComponentRef Id="cmpBB94B2B2A45F7D437EB0237D9B292BFE" />
<ComponentRef Id="cmp4AE74E37B2A44D5890DBC4D86DDFDD40" />
<ComponentRef Id="cmp095AB0635AB59E44C60473C62E9B6C84" />
<ComponentRef Id="cmp361542BC212F1EFD07C4EE7A6496E254" />
<ComponentRef Id="cmp1D09E2F4BC62197FC8C187ECF16B08D0" />
<ComponentRef Id="cmp99AAC04E82A333BB124A68DC3223D23A" />
<ComponentRef Id="cmp778481F5B466AD6013B4210ED68B3172" />
Expand Down Expand Up @@ -4799,6 +4833,7 @@
<ComponentRef Id="cmpE1EAFD7E808AF4C192C5D45154BB2136" />
<ComponentRef Id="cmp0313F8F73743B761E3DC5BBE65D6FB04" />
<ComponentRef Id="cmpFA98ECC9A87BB49B7FC68AC0CDC89955" />
<ComponentRef Id="cmp35343F87E4C47BED5F3495E072870B4E" />
<ComponentRef Id="cmpD7030FC24236E343750765385BE1F3CD" />
<ComponentRef Id="cmpEA17278B9ACE7EA6B46B6A830432B689" />
<ComponentRef Id="cmpCD4BD720F4FB285B9F6E876D94880D64" />
Expand Down Expand Up @@ -4924,6 +4959,7 @@
<ComponentRef Id="cmp2DA9A48FC4B479D897435D7DCFA6DDE3" />
<ComponentRef Id="cmpA10291DA4F33CEBFB790A935E68C763C" />
<ComponentRef Id="cmp8839023EABF68726F33F2E22907EE5CA" />
<ComponentRef Id="cmp91F23AEF11B1513BE8D9605E0197AFD6" />
<ComponentRef Id="cmp0B5A5E6BA5861771073ED88DCAB35DCC" />
<ComponentRef Id="cmp8FDC59E62622D98C6BE19E68ABC2666F" />
<ComponentRef Id="cmpE8892E4AE524E10FC9808A04A8A7D4BE" />
Expand Down
11 changes: 10 additions & 1 deletion src/Common/Commands.Common/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Common/Commands.Common/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1358,4 +1358,7 @@ use and privacy statement at &lt;url&gt; and (c) agree to sharing my contact inf
<data name="AzureProfileMustNotBeNull" xml:space="preserve">
<value>Selected profile must not be null.</value>
</data>
<data name="SwitchAzureModeDeprecated" xml:space="preserve">
<value>The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.</value>
</data>
</root>
2 changes: 2 additions & 0 deletions src/Common/Commands.Profile/SwitchAzureMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using System;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common.Properties;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Common.Authentication;

Expand All @@ -34,6 +35,7 @@ public class SwitchAzureMode : AzurePSCmdlet

public override void ExecuteCmdlet()
{
WriteWarning(Resources.SwitchAzureModeDeprecated);
AzureModule moduleToImport = (AzureModule)Enum.Parse(typeof(AzureModule), Name, false);
AzureModule moduleToRemove = moduleToImport == AzureModule.AzureResourceManager ? AzureModule.AzureServiceManagement : AzureModule.AzureResourceManager;
RemoveAzureModule(FileUtilities.GetModuleName(moduleToRemove), FileUtilities.GetPSModulePathForModule(moduleToRemove));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ CmdletsToExport = '*'
VariablesToExport = '*'

# Aliases to export from this module
AliasesToExport = @()
AliasesToExport = @(
'Get-AzureSqlDatabaseServerAuditingPolicy',
'Remove-AzureSqlDatabaseServerAuditing',
'Set-AzureSqlDatabaseServerAuditingPolicy',
'Use-AzureSqlDatabaseServerAuditingPolicy'
)

# List of all modules packaged with this module
ModuleList = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@
<Content Include="AzureResourceManager.psd1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="ResourceManagerStartup.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="MSSharedLibKey.snk" />
<None Include="packages.config" />
<None Include="PostBuild.ps1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,42 @@

using System.Collections.Generic;
using System.Management.Automation;
using System.Reflection;
using Microsoft.Azure.Commands.Resources.Models;
using System.IO;
using Microsoft.Azure.Common.Authentication;

namespace Microsoft.Azure.Commands.Resources
{
/// <summary>
/// Get the available locations for certain resource types.
/// </summary>
[Cmdlet(VerbsCommon.Get, "AzureLocation"), OutputType(typeof(List<PSResourceProviderLocationInfo>))]
public class GetAzureLocationCommand : ResourcesBaseCmdlet
public class GetAzureLocationCommand : ResourcesBaseCmdlet, IModuleAssemblyInitializer
{
public override void ExecuteCmdlet()
{
WriteObject(ResourcesClient.GetLocations(), true);
}

/// <summary>
/// Load global aliases for ARM
/// </summary>
public void OnImport()
{
try
{
System.Management.Automation.PowerShell invoker = null;
invoker = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace);
invoker.AddScript(File.ReadAllText(FileUtilities.GetContentFilePath(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"ResourceManagerStartup.ps1")));
invoker.Invoke();
}
catch
{
// This will throw exception for tests, ignore.
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

@{
# Sql aliases
"Get-AzureSqlDatabaseServerAuditingPolicy" = "Get-AzureSqlServerAuditingPolicy";
"Remove-AzureSqlDatabaseServerAuditing" = "Remove-AzureSqlServerAuditing";
"Set-AzureSqlDatabaseServerAuditingPolicy" = "Set-AzureSqlServerAuditingPolicy";
"Use-AzureSqlDatabaseServerAuditingPolicy" = "Use-AzureSqlServerAuditingPolicy";
}.GetEnumerator() | Select @{Name='Name'; Expression={$_.Key}}, @{Name='Value'; Expression={$_.Value}} | New-Alias -Description "AzureAlias"
Loading