Change the way we call powershell in AzurePSCmdlet#183
Merged
Conversation
Member
Author
|
Dingmeng, I've tested it in a local build and it works. |
20665a0 to
32e20db
Compare
dingmeng-xue
approved these changes
May 15, 2020
Member
Author
|
Tested. It works perfectly: C:\Users\yeliu> $job = Start-Job -ScriptBlock {
>> $DebugPreference = "Continue";
>> Write-Debug "DEBUG - LOOK AT ME OVER HERE";
>> $global:ErrorActionPreference = "Stop"
>> Import-Module ~\isra-fel\azure-powershell\artifacts\Debug\Az.Accounts\
>> Get-AzContext
>>
>> $DebugPreference = "Continue";
>> Write-Debug "DEBUG - LOOK AT ME DOWN HERE";
>> }
C:\Users\yeliu> $job | Wait-Job
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Completed True localhost …
C:\Users\yeliu> $DebugRecords = $job.ChildJobs[0].debug.readall()
C:\Users\yeliu> foreach ($r in $DebugRecords) {
>> Write-Host $r
>> }
DEBUG - LOOK AT ME OVER HERE
Sought all Az modules and got latest version 3.8.0
4:21:24 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
4:21:24 PM - using account id 'yeliu@microsoft.com'...
AzureQoSEvent: CommandName - Get-AzContext; IsSuccess - True; Duration - 00:00:00.2392776;
Finish sending metric.
4:21:25 PM - GetAzureRMContextCommand end processing.
DEBUG - LOOK AT ME DOWN HERE |
Merged
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fi xes Azure/azure-powershell#11492