-
Notifications
You must be signed in to change notification settings - Fork 4k
Add -AsJob to Resources cmdlets and fix base cmdlets #5153
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
Conversation
@@ -32,6 +32,9 @@ public TagsClient TagsClient | |||
ErrorLogger = WriteErrorWithTimestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maddieclayton should these loggers be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
VerboseLogger = WriteVerboseWithTimestamp, | ||
ErrorLogger = WriteErrorWithTimestamp | ||
}; | ||
{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maddieclayton please remove these brackets from every file where they remain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -88,7 +88,8 @@ function Test-CreatesAndRemoveResourceGroupViaPiping | |||
New-AzureRmResourceGroup -Name $rgname1 -Location $location | |||
New-AzureRmResourceGroup -Name $rgname2 -Location $location | |||
|
|||
Get-AzureRmResourceGroup | where {$_.ResourceGroupName -eq $rgname1 -or $_.ResourceGroupName -eq $rgname2} | Remove-AzureRmResourceGroup -Force | |||
Get-AzureRmResourceGroup | where {$_.ResourceGroupName -eq $rgname1 -or $_.ResourceGroupName -eq $rgname2} | Remove-AzureRmResourceGroup -Force -AsJob | |||
Get-Job | Wait-Job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, assign the output to a variable and pass the variable in the the job cmdlets as a positional parameter.
i.e.
$job = (Get-AzureRmResourceGroup ... | Remove-AzureRmResourceGroup -AsJob...)
Wait-Job $job
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply this to all the additional tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Description
Adds -AsJob to New-AzureRmResourceGroupDeployment and Remove-AzureRmResourceGroup (and updates tests). Also adds fix to all base cmdlets that would cause an error in logging for jobs.
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines