Skip to content
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

Fix issue with ARM and RDFE cmdlets that share the same name/alias #3882

Merged
merged 4 commits into from
May 5, 2017
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
10 changes: 4 additions & 6 deletions src/ResourceManager/Compute/AzureRM.Compute.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ CmdletsToExport = 'Remove-AzureRmAvailabilitySet', 'Get-AzureRmAvailabilitySet',
'Set-AzureRmVMDiagnosticsExtension', 'Set-AzureRmVMExtension',
'Remove-AzureRmVMExtension', 'Get-AzureRmVMExtension',
'Get-AzureRmVMSqlServerExtension',
'New-AzureVMSqlServerAutoBackupConfig',
'New-AzureVMSqlServerAutoPatchingConfig',
'New-AzureVMSqlServerKeyVaultCredentialConfig',
'New-AzureRmVMSqlServerAutoBackupConfig',
'New-AzureRmVMSqlServerAutoPatchingConfig',
'New-AzureRmVMSqlServerKeyVaultCredentialConfig',
'Remove-AzureRmVMSqlServerExtension',
'Set-AzureRmVMSqlServerExtension', 'Get-AzureRmVMImage',
'Get-AzureRmVMAccessExtension', 'Remove-AzureRmVMAccessExtension',
Expand Down Expand Up @@ -167,9 +167,7 @@ CmdletsToExport = 'Remove-AzureRmAvailabilitySet', 'Get-AzureRmAvailabilitySet',
# VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = 'New-AzureRmVMSqlServerAutoBackupConfig',
'New-AzureRmVMSqlServerAutoPatchingConfig',
'New-AzureRmVMSqlServerKeyVaultCredentialConfig'
AliasesToExport = ''

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,12 @@ namespace Microsoft.Azure.Commands.Compute
/// </summary>
[Cmdlet(
VerbsCommon.New,
AzureVMSqlServerAutoBackupConfigNoun,
ProfileNouns.VirtualMachineSqlServerAutoBackupConfig,
DefaultParameterSetName = StorageUriParamSetName),
Alias(
VerbsCommon.New + "-" + ProfileNouns.VirtualMachineSqlServerAutoBackupConfig),
OutputType(
typeof(AutoBackupSettings))]
public class NewAzureVMSqlServerAutoBackupConfigCommand : AzureRMCmdlet
{
protected const string AzureVMSqlServerAutoBackupConfigNoun = "AzureVMSqlServerAutoBackupConfig";

protected const string StorageContextParamSetName = "StorageContextSqlServerAutoBackup";
protected const string StorageUriParamSetName = "StorageUriSqlServerAutoBackup";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@ namespace Microsoft.Azure.Commands.Compute
/// </summary>
[Cmdlet(
VerbsCommon.New,
AzureVMSqlServerAutoPatchingConfigNoun),
Alias(
VerbsCommon.New + "-" + ProfileNouns.VirtualMachineSqlServerAutoPatchingConfig),
ProfileNouns.VirtualMachineSqlServerAutoPatchingConfig),
OutputType(
typeof(AutoPatchingSettings))]
public class NewAzureVMSqlServerAutoPatchingConfigCommand : PSCmdlet
{
protected const string AzureVMSqlServerAutoPatchingConfigNoun = "AzureVMSqlServerAutoPatchingConfig";

[Parameter]
public SwitchParameter Enable { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,12 @@ namespace Microsoft.Azure.Commands.Compute
/// </summary>
[Cmdlet(
VerbsCommon.New,
AzureVMSqlServerKeyVaultCredentialConfigNoun,
ProfileNouns.VirtualMachineSqlServerKeyVaultCredentialConfig,
SupportsShouldProcess = true),
Alias(
VerbsCommon.New + "-" + ProfileNouns.VirtualMachineSqlServerKeyVaultCredentialConfig),
OutputType(
typeof(KeyVaultCredentialSettings))]
public class NewAzureVMSqlServerKeyVaultCredentialConfigCommand : PSCmdlet
{
/// <summary>
/// Configuration object friendly name
/// </summary>
protected const string AzureVMSqlServerKeyVaultCredentialConfigNoun = "AzureVMSqlServerKeyVaultCredentialConfig";

[Parameter(
Mandatory = true,
Position = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ Creates a virtual machine.
### [New-AzureRmVMConfig](New-AzureRmVMConfig.md)
Creates a configurable virtual machine object.

### [New-AzureRmVMSqlServerAutoBackupConfig](New-AzureRmVMSqlServerAutoBackupConfig.md)
Creates a configuration object for SQL Server automatic backup.

### [New-AzureRmVMSqlServerAutoPatchingConfig](New-AzureRmVMSqlServerAutoPatchingConfig.md)
Creates a configuration object for automatic patching on a virtual machine.

### [New-AzureRmVMSqlServerKeyVaultCredentialConfig](New-AzureRmVMSqlServerKeyVaultCredentialConfig.md)
Creates a configuration object for SQL server key vault credential on a virtual machine.

### [New-AzureRmVmss](New-AzureRmVmss.md)
Creates a VMSS.

Expand All @@ -212,15 +221,6 @@ Creates an IP configuration for a network interface of a VMSS.
### [New-AzureRmVmssVaultCertificateConfig](New-AzureRmVmssVaultCertificateConfig.md)
Creates a Key Vault certificate configuration.

### [New-AzureVMSqlServerAutoBackupConfig](New-AzureVMSqlServerAutoBackupConfig.md)
Creates a configuration object for SQL Server automatic backup.

### [New-AzureVMSqlServerAutoPatchingConfig](New-AzureVMSqlServerAutoPatchingConfig.md)
Creates a configuration object for automatic patching on a virtual machine.

### [New-AzureVMSqlServerKeyVaultCredentialConfig](New-AzureVMSqlServerKeyVaultCredentialConfig.md)
Creates a configuration object for SQL server key vault credential on a virtual machine.

### [Publish-AzureRmVMDscConfiguration](Publish-AzureRmVMDscConfiguration.md)
Uploads a DSC script to Azure blob storage.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace Microsoft.Azure.Commands.Profile
{
[Cmdlet(VerbsLifecycle.Disable, "AzureRmDataCollection", SupportsShouldProcess = true)]
[Alias("Disable-AzureDataCollection")]
public class DisableAzureRmDataCollectionCommand : EnableAzureRmDataCollectionCommand
{
public override void ExecuteCmdlet()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
namespace Microsoft.Azure.Commands.Profile
{
[Cmdlet(VerbsLifecycle.Enable, "AzureRmDataCollection", SupportsShouldProcess = true)]
[Alias("Enable-AzureDataCollection")]
public class EnableAzureRmDataCollectionCommand : AzureRMCmdlet
{
protected override void BeginProcessing()
Expand Down
6 changes: 4 additions & 2 deletions tools/GenerateHelp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ if ($ValidateMarkdownHelp)
$Exceptions | ft
throw "A markdown file containing the help for a cmdlet is incomplete. Please check the exceptions provided for more details."
}

Remove-Item -Path "$NewExceptionsPath\ValidateHelpIssues.csv" -Force
else
{
Remove-Item -Path "$NewExceptionsPath\ValidateHelpIssues.csv" -Force
}
}

if ($GenerateMamlHelp)
Expand Down
8 changes: 4 additions & 4 deletions tools/HelpGeneration/Exceptions/ValidateHelpIssues.csv
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ AzureRM.CognitiveServices,Remove-AzureRmCognitiveServicesAccount.md,No examples
AzureRM.CognitiveServices,Set-AzureRmCognitiveServicesAccount.md,No examples found
AzureRM.Compute,Get-AzureRmVMADDomainExtension.md,No examples found
AzureRM.Compute,Get-AzureRmVMDscExtensionStatus.md,No examples found
AzureRM.Compute,New-AzureVMSqlServerKeyVaultCredentialConfig.md,No description found
AzureRM.Compute,New-AzureVMSqlServerKeyVaultCredentialConfig.md,No examples found
AzureRM.Compute,New-AzureRmVMSqlServerKeyVaultCredentialConfig.md,No description found
AzureRM.Compute,New-AzureRmVMSqlServerKeyVaultCredentialConfig.md,No examples found
AzureRM.Compute,Remove-AzureRmVMAccessExtension.md,No examples found
AzureRM.Compute,Remove-AzureRmVMBackup.md,No description found
AzureRM.Compute,Remove-AzureRmVMCustomScriptExtension.md,No examples found
Expand Down Expand Up @@ -334,8 +334,8 @@ Commands.Management.CognitiveServices,Remove-AzureRmCognitiveServicesAccount.md,
Commands.Management.CognitiveServices,Set-AzureRmCognitiveServicesAccount.md,No examples found
Commands.Compute,Get-AzureRmVMADDomainExtension.md,No examples found
Commands.Compute,Get-AzureRmVMDscExtensionStatus.md,No examples found
Commands.Compute,New-AzureVMSqlServerKeyVaultCredentialConfig.md,No description found
Commands.Compute,New-AzureVMSqlServerKeyVaultCredentialConfig.md,No examples found
Commands.Compute,New-AzureRmVMSqlServerKeyVaultCredentialConfig.md,No description found
Commands.Compute,New-AzureRmVMSqlServerKeyVaultCredentialConfig.md,No examples found
Commands.Compute,Remove-AzureRmVMAccessExtension.md,No examples found
Commands.Compute,Remove-AzureRmVMBackup.md,No description found
Commands.Compute,Remove-AzureRmVMCustomScriptExtension.md,No examples found
Expand Down
5 changes: 5 additions & 0 deletions tools/StaticAnalysis/Exceptions/BreakingChangeIssues.csv
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@
"Microsoft.Azure.Commands.MachineLearning.dll","Microsoft.Azure.Commands.MachineLearning.RemoveAzureMLWebService","Remove-AzureRmMlWebService","0","3000","The type of property 'LocationInfo' of type 'AssetItem' has changed from 'Microsoft.Azure.Management.MachineLearning.WebServices.Models.AssetLocation' to 'Microsoft.Azure.Management.MachineLearning.WebServices.Models.BlobLocation'.","Change the type of property 'LocationInfo' back to 'Microsoft.Azure.Management.MachineLearning.WebServices.Models.AssetLocation'."
"Microsoft.Azure.Commands.MachineLearning.dll","Microsoft.Azure.Commands.MachineLearning.RemoveAzureMLWebService","Remove-AzureRmMlWebService","0","3040","The generic type argument for 'property Parameters' has been changed from 'System.String' to 'Microsoft.Azure.Management.MachineLearning.WebServices.Models.WebServiceParameter'.","Change the generic type argument for 'property Parameters' back to 'System.String'."
"Microsoft.Azure.Commands.MachineLearning.dll","Microsoft.Azure.Commands.MachineLearning.UpdateAzureMLWebService","Update-AzureRmMlWebService","0","3040","The generic type argument for 'property Parameters' has been changed from 'System.String' to 'Microsoft.Azure.Management.MachineLearning.WebServices.Models.WebServiceParameter'.","Change the generic type argument for 'property Parameters' back to 'System.String'."
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.NewAzureVMSqlServerAutoBackupConfigCommand","New-AzureVMSqlServerAutoBackupConfig","0","1000","The cmdlet 'New-AzureVMSqlServerAutoBackupConfig' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'New-AzureVMSqlServerAutoBackupConfig' back to the module, or add an alias to the original cmdlet name."
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.NewAzureVMSqlServerAutoPatchingConfigCommand","New-AzureVMSqlServerAutoPatchingConfig","0","1000","The cmdlet 'New-AzureVMSqlServerAutoPatchingConfig' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'New-AzureVMSqlServerAutoPatchingConfig' back to the module, or add an alias to the original cmdlet name."
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.NewAzureVMSqlServerKeyVaultCredentialConfigCommand","New-AzureVMSqlServerKeyVaultCredentialConfig","0","1000","The cmdlet 'New-AzureVMSqlServerKeyVaultCredentialConfig' has been removed and no alias was found for the original cmdlet name.","Add the cmdlet 'New-AzureVMSqlServerKeyVaultCredentialConfig' back to the module, or add an alias to the original cmdlet name."
"Microsoft.Azure.Commands.Profile.dll","Microsoft.Azure.Commands.Profile.DisableAzureRmDataCollectionCommand","Disable-AzureRmDataCollection","0","1010","The cmdlet 'Disable-AzureRmDataCollection' no longer supports the alias 'Disable-AzureDataCollection'.","Add the alias 'Disable-AzureDataCollection back to the cmdlet 'Disable-AzureRmDataCollection'."
"Microsoft.Azure.Commands.Profile.dll","Microsoft.Azure.Commands.Profile.EnableAzureRmDataCollectionCommand","Enable-AzureRmDataCollection","0","1010","The cmdlet 'Enable-AzureRmDataCollection' no longer supports the alias 'Enable-AzureDataCollection'.","Add the alias 'Enable-AzureDataCollection back to the cmdlet 'Enable-AzureRmDataCollection'."
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.Namespace.GetAzureRmEventHubNamespace","Get-AzureRmEventHubNamespace","0","3010","The property 'ResourceGroupName' of type 'NamespaceAttributes' has been removed.","Add the property 'ResourceGroupName' back to type 'NamespaceAttributes'."
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.Namespace.NewAzureEventHubNamespace","New-AzureRmEventHubNamespace","0","3010","The property 'ResourceGroupName' of type 'NamespaceAttributes' has been removed.","Add the property 'ResourceGroupName' back to type 'NamespaceAttributes'."
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.Namespace.SetAzureEventHubNamespace","Set-AzureRmEventHubNamespace","0","3010","The property 'ResourceGroupName' of type 'NamespaceAttributes' has been removed.","Add the property 'ResourceGroupName' back to type 'NamespaceAttributes'."
Expand Down
5 changes: 4 additions & 1 deletion tools/StaticAnalysis/Exceptions/SignatureIssues.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1473,4 +1473,7 @@
"Microsoft.Azure.Commands.Relay.dll","Microsoft.Azure.Commands.Relay.Commands.Namespace.RemoveAzureRmRelayNamespace","Remove-AzureRmRelayNamespace","2","8210","Remove-AzureRmRelayNamespace does not have a Force parameter but the cmdlet verb 'Remove' indicates that it may perform destructive actions under certain circumstances. Consider whether the cmdlet should have a Force parameter anduse ShouldContinue under some circumstances. ","Consider wether the cmdlet should have a Force parameter and use ShouldContinue under some circumstances. "
"Microsoft.Azure.Commands.Relay.dll","Microsoft.Azure.Commands.Relay.Commands.Namespace.SetAzureRelayNamespace","Set-AzureRmRelayNamespace","2","8210","Set-AzureRmRelayNamespace does not have a Force parameter but the cmdlet verb 'Set' indicates that it may perform destructive actions under certain circumstances. Consider whether the cmdlet should have a Force parameter anduse ShouldContinue under some circumstances. ","Consider wether the cmdlet should have a Force parameter and use ShouldContinue under some circumstances. "
"Microsoft.Azure.Commands.Sql.dll","Microsoft.Azure.Commands.Sql.FailoverGroup.Cmdlet.SetAzureSqlFailoverGroup","Set-AzureRmSqlDatabaseFailoverGroup","2","8210","Set-AzureRmSqlDatabaseFailoverGroup does not have a Force parameter but the cmdlet verb 'Set' indicates that it may perform destructive actions under certain circumstances. Consider whether the cmdlet should have a Force parameter anduse ShouldContinue under some circumstances. ","Consider wether the cmdlet should have a Force parameter and use ShouldContinue under some circumstances. "
"Microsoft.Azure.Commands.Profile.dll","Microsoft.Azure.Commands.Profile.SendFeedbackCommand","Send-Feedback","1","8100","Send-Feedback Does not support ShouldProcess but the cmdlet verb Send indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue."
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.NewAzureVMSqlServerAutoBackupConfigCommand","New-AzureRmVMSqlServerAutoBackupConfig","1","8100","New-AzureRmVMSqlServerAutoBackupConfig Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.NewAzureVMSqlServerAutoBackupConfigCommand","New-AzureRmVMSqlServerAutoBackupConfig","1","8410","Parameter BackupSystemDbs of cmdlet New-AzureRmVMSqlServerAutoBackupConfig does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
"Microsoft.Azure.Commands.Compute.dll","Microsoft.Azure.Commands.Compute.NewAzureVMSqlServerAutoPatchingConfigCommand","New-AzureRmVMSqlServerAutoPatchingConfig","1","8100","New-AzureRmVMSqlServerAutoPatchingConfig Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
"Microsoft.Azure.Commands.Profile.dll","Microsoft.Azure.Commands.Profile.SendFeedbackCommand","Send-Feedback","1","8100","Send-Feedback Does not support ShouldProcess but the cmdlet verb Send indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue."