Skip to content

Commit c8957df

Browse files
committed
Fix compilation errors in build, suppress some breaking change exceptions
1 parent 744e60e commit c8957df

File tree

5 files changed

+89
-70
lines changed

5 files changed

+89
-70
lines changed

src/ResourceManager/Common/Commands.ResourceManager.Common/ArgumentCompleters/ResourceTypeCompleter.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters
2929
/// <summary>
3030
/// This attribute will allow the user to autocomplete the -ResourceType parameter of a cmdlet with valid resource types
3131
/// </summary>
32-
public class ResourceTypeCompleterAttribute : PSCompleterBaseAttribute
32+
public class ResourceTypeCompleterAttribute : ArgumentCompleterAttribute
3333
{
3434
private static IDictionary<int, IList<String>> _resourceTypesDictionary = new ConcurrentDictionary<int, IList<string>>();
3535
private static readonly object _lock = new object();
@@ -92,19 +92,12 @@ protected static IList<String> ResourceTypes
9292
}
9393

9494
/// <summary>
95-
/// This class will provide a list of resource groups that are available to the user (with default resource group first if it exists). This will then be available to the user to tab through.
96-
/// Example: [Parameter(ParameterSetName = ListByNameInTenantParameterSet, ValueFromPipelineByPropertyName = true, Mandatory = false), ResourceGroupCompleter()]
95+
/// This class will provide a list of resource types that are available to the user. This will then be available to the user to tab through.
9796
/// </summary>
98-
/// <param name="resourceTypes"></param>
99-
public ResourceTypeCompleterAttribute()
97+
public ResourceTypeCompleterAttribute() : base(CreateScriptBlock())
10098
{
10199
}
102100

103-
public override string[] GetCompleterValues()
104-
{
105-
return GetResourceTypes();
106-
}
107-
108101
public static string[] GetResourceTypes(int timeout)
109102
{
110103
_timeout = timeout;
@@ -147,7 +140,7 @@ public static List<string> CreateResourceTypeList(IPage<Provider> result)
147140
#if DEBUG
148141
else
149142
{
150-
throw new Exception("Result from client.ResourceGroups is null");
143+
throw new Exception("Result from client.Providers.ListAsync() is null");
151144
}
152145
#endif
153146
return tempResourceTypeList;

src/ResourceManager/Common/Commands.ResourceManager.Common/ArgumentCompleters/ScopeCompleter.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters
2626
using System.Linq;
2727
using System.Management.Automation;
2828

29-
public class ScopeCompleterAttribute : PSCompleterBaseAttribute
29+
public class ScopeCompleterAttribute : ArgumentCompleterAttribute
3030
{
3131
public static IDictionary<int, IList<string>> _scopeDictionary = new ConcurrentDictionary<int, IList<string>>();
3232
private static readonly object _lock = new object();
@@ -85,9 +85,11 @@ protected static IList<String> Scopes
8585
}
8686
}
8787

88-
public override string[] GetCompleterValues()
88+
/// <summary>
89+
/// This class will provide a list of scopes that are available to the user. This will then be available to the user to tab through.
90+
/// </summary>
91+
public ScopeCompleterAttribute() : base(CreateScriptBlock())
8992
{
90-
return GetScopes();
9193
}
9294

9395
public static string[] GetScopes(int timeout)

src/ResourceManager/Resources/AzureRM.Resources.psd1

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 4/3/2018
6+
# Generated on: 4/20/2018
77
#
88

99
@{
@@ -54,7 +54,7 @@ CLRVersion = '4.0'
5454
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.6.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = '.\Microsoft.Azure.Management.ResourceManager.dll',
57+
RequiredAssemblies = '.\Microsoft.Azure.Management.ResourceManager.dll',
5858
'.\Microsoft.Azure.Management.Authorization.dll'
5959

6060
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
@@ -64,72 +64,74 @@ RequiredAssemblies = '.\Microsoft.Azure.Management.ResourceManager.dll',
6464
TypesToProcess = 'Microsoft.Azure.Commands.ResourceManager.Cmdlets.Types.ps1xml'
6565

6666
# Format files (.ps1xml) to be loaded when importing this module
67-
FormatsToProcess = '.\Microsoft.Azure.Commands.Resources.format.ps1xml',
67+
FormatsToProcess = '.\Microsoft.Azure.Commands.Resources.format.ps1xml',
6868
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.format.ps1xml'
6969

7070
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
71-
NestedModules = @('.\Microsoft.Azure.Commands.Resources.dll',
71+
NestedModules = @('.\Microsoft.Azure.Commands.Resources.dll',
7272
'.\Microsoft.Azure.Commands.ResourceManager.Cmdlets.dll')
7373

7474
# Functions 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 functions to export.
7575
FunctionsToExport = @()
7676

7777
# Cmdlets 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 cmdlets to export.
78-
CmdletsToExport = 'Get-AzureRmProviderOperation', 'Remove-AzureRmRoleAssignment',
79-
'Get-AzureRmRoleAssignment', 'New-AzureRmRoleAssignment',
80-
'Get-AzureRmRoleDefinition', 'New-AzureRmRoleDefinition',
81-
'Set-AzureRmRoleDefinition', 'Remove-AzureRmRoleDefinition',
82-
'Get-AzureRmADAppCredential', 'Get-AzureRmADApplication',
83-
'Add-AzureRmADGroupMember', 'Get-AzureRmADGroupMember',
84-
'Remove-AzureRmADGroupMember', 'Get-AzureRmADGroup',
85-
'New-AzureRmADGroup', 'Remove-AzureRmADGroup',
86-
'Get-AzureRmADServicePrincipal', 'Get-AzureRmADSpCredential',
87-
'Get-AzureRmADUser', 'New-AzureRmADAppCredential',
88-
'New-AzureRmADSpCredential', 'New-AzureRmADUser',
89-
'Remove-AzureRmADAppCredential', 'Remove-AzureRmADApplication',
90-
'New-AzureRmADApplication', 'Remove-AzureRmADServicePrincipal',
91-
'New-AzureRmADServicePrincipal', 'Remove-AzureRmADSpCredential',
92-
'Remove-AzureRmADUser', 'Update-AzureRmADApplication',
93-
'Update-AzureRmADServicePrincipal', 'Update-AzureRmADUser',
94-
'Remove-AzureRmResourceGroup', 'Get-AzureRmProviderFeature',
95-
'Register-AzureRmProviderFeature', 'Get-AzureRmLocation',
96-
'Export-AzureRmResourceGroup',
97-
'Get-AzureRmResourceProvider', 'Register-AzureRmResourceProvider',
98-
'Unregister-AzureRmResourceProvider',
99-
'Get-AzureRmResourceGroupDeployment',
100-
'New-AzureRmResourceGroupDeployment',
101-
'Remove-AzureRmResourceGroupDeployment',
102-
'Stop-AzureRmResourceGroupDeployment',
103-
'Test-AzureRmResourceGroupDeployment', 'Set-AzureRmResourceGroup',
104-
'New-AzureRmResourceGroup', 'Get-AzureRmResourceGroup',
105-
'Save-AzureRmResourceGroupDeploymentTemplate',
106-
'Get-AzureRmResourceGroupDeploymentOperation',
107-
'Get-AzureRmResourceLock', 'Invoke-AzureRmResourceAction',
108-
'Find-AzureRmResource', 'Move-AzureRmResource',
109-
'New-AzureRmResourceLock', 'Get-AzureRmPolicyAssignment',
110-
'Get-AzureRmPolicyDefinition', 'Get-AzureRmPolicySetDefinition',
111-
'New-AzureRmPolicyAssignment', 'New-AzureRmPolicyDefinition',
112-
'New-AzureRmPolicySetDefinition', 'Remove-AzureRmPolicyAssignment',
113-
'Remove-AzureRmPolicyDefinition',
114-
'Remove-AzureRmPolicySetDefinition', 'Set-AzureRmPolicyAssignment',
115-
'Set-AzureRmPolicyDefinition', 'Set-AzureRmPolicySetDefinition',
116-
'Remove-AzureRmResource', 'Remove-AzureRmResourceLock',
117-
'Set-AzureRmResource', 'New-AzureRmResource',
118-
'Set-AzureRmResourceLock', 'Get-AzureRmResource',
119-
'Get-AzureRmManagedApplicationDefinition',
120-
'New-AzureRmManagedApplicationDefinition',
121-
'Set-AzureRmManagedApplicationDefinition',
122-
'Remove-AzureRmManagedApplicationDefinition',
123-
'Get-AzureRmManagedApplication', 'New-AzureRmManagedApplication',
78+
CmdletsToExport = 'Get-AzureRmProviderOperation', 'Remove-AzureRmRoleAssignment',
79+
'Get-AzureRmRoleAssignment', 'New-AzureRmRoleAssignment',
80+
'Get-AzureRmRoleDefinition', 'New-AzureRmRoleDefinition',
81+
'Set-AzureRmRoleDefinition', 'Remove-AzureRmRoleDefinition',
82+
'Get-AzureRmADAppCredential', 'Get-AzureRmADApplication',
83+
'Add-AzureRmADGroupMember', 'Get-AzureRmADGroupMember',
84+
'Remove-AzureRmADGroupMember', 'Get-AzureRmADGroup',
85+
'New-AzureRmADGroup', 'Remove-AzureRmADGroup',
86+
'Get-AzureRmADServicePrincipal', 'Get-AzureRmADSpCredential',
87+
'Get-AzureRmADUser', 'New-AzureRmADAppCredential',
88+
'New-AzureRmADSpCredential', 'New-AzureRmADUser',
89+
'Remove-AzureRmADAppCredential', 'Remove-AzureRmADApplication',
90+
'New-AzureRmADApplication', 'Remove-AzureRmADServicePrincipal',
91+
'New-AzureRmADServicePrincipal', 'Remove-AzureRmADSpCredential',
92+
'Remove-AzureRmADUser', 'Update-AzureRmADApplication',
93+
'Update-AzureRmADServicePrincipal', 'Update-AzureRmADUser',
94+
'Remove-AzureRmResourceGroup', 'Get-AzureRmProviderFeature',
95+
'Register-AzureRmProviderFeature', 'Get-AzureRmLocation',
96+
'Export-AzureRmResourceGroup', 'Get-AzureRmResourceProvider',
97+
'Register-AzureRmResourceProvider',
98+
'Unregister-AzureRmResourceProvider',
99+
'Get-AzureRmResourceGroupDeployment',
100+
'New-AzureRmResourceGroupDeployment',
101+
'Remove-AzureRmResourceGroupDeployment',
102+
'Stop-AzureRmResourceGroupDeployment',
103+
'Test-AzureRmResourceGroupDeployment', 'Set-AzureRmResourceGroup',
104+
'New-AzureRmResourceGroup', 'Get-AzureRmResourceGroup',
105+
'Save-AzureRmResourceGroupDeploymentTemplate',
106+
'Get-AzureRmResourceGroupDeploymentOperation',
107+
'Get-AzureRmResourceLock', 'Invoke-AzureRmResourceAction',
108+
'Move-AzureRmResource', 'New-AzureRmResourceLock',
109+
'Get-AzureRmPolicyAssignment', 'Get-AzureRmPolicyDefinition',
110+
'Get-AzureRmPolicySetDefinition', 'New-AzureRmPolicyAssignment',
111+
'New-AzureRmPolicyDefinition', 'New-AzureRmPolicySetDefinition',
112+
'Remove-AzureRmPolicyAssignment', 'Remove-AzureRmPolicyDefinition',
113+
'Remove-AzureRmPolicySetDefinition', 'Set-AzureRmPolicyAssignment',
114+
'Set-AzureRmPolicyDefinition', 'Set-AzureRmPolicySetDefinition',
115+
'Remove-AzureRmResource', 'Remove-AzureRmResourceLock',
116+
'Set-AzureRmResource', 'New-AzureRmResource',
117+
'Set-AzureRmResourceLock', 'Get-AzureRmResource',
118+
'Get-AzureRmManagedApplicationDefinition',
119+
'New-AzureRmManagedApplicationDefinition',
120+
'Set-AzureRmManagedApplicationDefinition',
121+
'Remove-AzureRmManagedApplicationDefinition',
122+
'Get-AzureRmManagedApplication', 'New-AzureRmManagedApplication',
124123
'Set-AzureRmManagedApplication', 'Remove-AzureRmManagedApplication'
125124

126125
# Variables to export from this module
127126
# VariablesToExport = @()
128127

129128
# 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.
130-
AliasesToExport = 'Get-AzureRmResourceProviderAction', 'Get-AzureRmADServicePrincipalCredential',
131-
'New-AzureRmADServicePrincipalCredential', 'Remove-AzureRmADServicePrincipalCredential',
132-
'Set-AzureRmADApplication', 'Set-AzureRmADServicePrincipal', 'Set-AzureRmADUser'
129+
AliasesToExport = 'Get-AzureRmResourceProviderAction',
130+
'Get-AzureRmADServicePrincipalCredential',
131+
'New-AzureRmADServicePrincipalCredential',
132+
'Remove-AzureRmADServicePrincipalCredential',
133+
'Set-AzureRmADApplication', 'Set-AzureRmADServicePrincipal',
134+
'Set-AzureRmADUser'
133135

134136
# DSC resources to export from this module
135137
# DscResourcesToExport = @()
@@ -170,7 +172,7 @@ PrivateData = @{
170172
# ExternalModuleDependencies = @()
171173

172174
} # End of PSData hashtable
173-
175+
174176
} # End of PrivateData hashtable
175177

176178
# HelpInfo URI of this module

src/ResourceManager/Subscription/Commands.Subscription/Cmdlets/NewAzureRmSubscription.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public ISubscriptionClient SubscriptionClient
7777
[Parameter(Mandatory = false, HelpMessage = "The user(s) or group object(s) id(s) to be granted Owner access to the subscription.")]
7878
[Alias("OwnerId", "OwnerPrincipalId")]
7979
public string[] OwnerObjectId { get; set; }
80-
80+
8181
[Parameter(Mandatory = false, HelpMessage = "The user(s) to be granted Owner access to the subscription.")]
8282
[Alias("OwnerEmail", "OwnerUserPrincipalName")]
8383
public string[] OwnerSignInName { get; set; }
@@ -122,7 +122,7 @@ private string[] ResolveObjectIds(string[] objectIds, string[] servicePrincipalN
122122
{
123123
foreach (string spn in servicePrincipalNames)
124124
{
125-
uniqueObjectIds.Add(Guid.Parse(ActiveDirectoryClient.GetObjectIdFromSPN(spn)));
125+
uniqueObjectIds.Add(ActiveDirectoryClient.GetObjectIdFromSPN(spn));
126126
}
127127
}
128128

0 commit comments

Comments
 (0)