Skip to content

Commit 3e92457

Browse files
committed
Adding additional examples
1 parent f2fdc9c commit 3e92457

File tree

1 file changed

+113
-11
lines changed

1 file changed

+113
-11
lines changed

src/ResourceManager/Profile/Commands.Profile/help/Resolve-AzureRmError.md

Lines changed: 113 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,21 @@ schema: 2.0.0
77
# Resolve-AzureRmError
88

99
## SYNOPSIS
10-
1110
Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors.
1211

1312
## SYNTAX
1413

1514
### AnyErrorParameterSet (Default)
16-
17-
```powershell
15+
```
1816
Resolve-AzureRmError [[-Error] <ErrorRecord[]>] [<CommonParameters>]
1917
```
2018

2119
### LastErrorParameterSet
22-
23-
```powershell
20+
```
2421
Resolve-AzureRmError [-Last] [<CommonParameters>]
2522
```
2623

2724
## DESCRIPTION
28-
2925
Resolves and displays detailed information about errors in the current PowerShell session, including where the error
3026
occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides
3127
additional detail in debugging service issues, including complete detail about the request and server response
@@ -34,8 +30,7 @@ that caused the error.
3430
## EXAMPLES
3531

3632
### Example 1: Resolve the Last Error
37-
38-
```powershell
33+
```
3934
PS C:\> Resolve-AzureRmError -Last
4035
4136
HistoryId: 3
@@ -60,10 +55,119 @@ HistoryId : 3
6055

6156
Get details of the last error.
6257

58+
### Example 2: Resolve all Errors in the Session
59+
```
60+
PS C:\> Resolve-AzureRmError
61+
62+
63+
HistoryId: 8
64+
65+
66+
RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d
67+
Message : Resource group 'contoso' could not be found.
68+
ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found.
69+
(System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError])
70+
ServerResponse : {NotFound}
71+
RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co
72+
ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01}
73+
InvocationInfo : {Get-AzureRmStorageAccount}
74+
Line : Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso
75+
Position : At line:1 char:1
76+
+ Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso
77+
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync
79+
>d__8.MoveNext()
80+
--- End of stack trace from previous location where exception was thrown ---
81+
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
82+
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
83+
at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7.
84+
MoveNext()
85+
--- End of stack trace from previous location where exception was thrown ---
86+
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
87+
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
88+
at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc
89+
ountsOperations operations, String resourceGroupName, String accountName)
90+
at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\
91+
zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto
92+
rageAccount.cs:line 70
93+
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in
94+
C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642
95+
HistoryId : 8
96+
97+
98+
HistoryId: 5
99+
100+
101+
Message : Run Login-AzureRmAccount to login.
102+
StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur
103+
e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85
104+
at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in
105+
C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin
106+
e 269
107+
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in
108+
C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299
109+
at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p
110+
owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320
111+
at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure-
112+
powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49
113+
at System.Management.Automation.Cmdlet.DoBeginProcessing()
114+
at System.Management.Automation.CommandProcessorBase.DoBegin()
115+
Exception : System.Management.Automation.PSInvalidOperationException
116+
InvocationInfo : {Get-AzureRmSubscription}
117+
Line : Get-AzureRmSubscription
118+
Position : At line:1 char:1
119+
+ Get-AzureRmSubscription
120+
+ ~~~~~~~~~~~~~~~~~~~~~~~
121+
HistoryId : 5
122+
```
123+
124+
Get details of all errors that have occurred in the current session.
125+
126+
### Example 3: Resolve a Specific Error
127+
```
128+
PS C:\> Resolve-AzureRmError $Error[0]
129+
130+
131+
HistoryId: 8
132+
133+
134+
RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d
135+
Message : Resource group 'contoso' could not be found.
136+
ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found.
137+
(System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError])
138+
ServerResponse : {NotFound}
139+
RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co
140+
ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01}
141+
InvocationInfo : {Get-AzureRmStorageAccount}
142+
Line : Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso
143+
Position : At line:1 char:1
144+
+ Get-AzureRmStorageAccount -ResourceGroupName contoso -Name contoso
145+
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146+
StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync
147+
>d__8.MoveNext()
148+
--- End of stack trace from previous location where exception was thrown ---
149+
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
150+
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
151+
at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7.
152+
MoveNext()
153+
--- End of stack trace from previous location where exception was thrown ---
154+
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
155+
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
156+
at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc
157+
ountsOperations operations, String resourceGroupName, String accountName)
158+
at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\
159+
zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto
160+
rageAccount.cs:line 70
161+
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in
162+
C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642
163+
HistoryId : 8
164+
```
165+
166+
Get details of the specified error.
167+
63168
## PARAMETERS
64169

65170
### -Error
66-
67171
One or more error records to resolve. If no parameters are specified, all errors in the session are resolved.
68172

69173
```yaml
@@ -104,9 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
104208
## OUTPUTS
105209
106210
### Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord
107-
108211
### Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord
109-
110212
### Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord
111213
112214
## NOTES

0 commit comments

Comments
 (0)