File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/ResourceManager/Automation/Commands.Automation/Model Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,18 @@ public class AutomationAccount
36
36
/// </param>
37
37
public AutomationAccount ( string resourceGroupName , AutomationManagement . Models . AutomationAccount automationAccount )
38
38
{
39
- Requires . Argument ( "ResourceGroupName" , resourceGroupName ) . NotNull ( ) ;
40
39
Requires . Argument ( "AutomationAccount" , automationAccount ) . NotNull ( ) ;
41
40
42
- this . ResourceGroupName = resourceGroupName ;
41
+
42
+ if ( ! string . IsNullOrEmpty ( resourceGroupName ) )
43
+ {
44
+ this . ResourceGroupName = resourceGroupName ;
45
+ }
46
+ else
47
+ {
48
+ this . ResourceGroupName = automationAccount . Id . Substring ( 1 ) . Split ( Convert . ToChar ( "/" ) ) [ 3 ] ;
49
+ }
50
+
43
51
this . AutomationAccountName = automationAccount . Name ;
44
52
this . Location = automationAccount . Location ;
45
53
You can’t perform that action at this time.
0 commit comments