@@ -7,25 +7,21 @@ schema: 2.0.0
7
7
# Resolve-AzureRmError
8
8
9
9
## SYNOPSIS
10
-
11
10
Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors.
12
11
13
12
## SYNTAX
14
13
15
14
### AnyErrorParameterSet (Default)
16
-
17
- ``` powershell
15
+ ```
18
16
Resolve-AzureRmError [[-Error] <ErrorRecord[]>] [<CommonParameters>]
19
17
```
20
18
21
19
### LastErrorParameterSet
22
-
23
- ``` powershell
20
+ ```
24
21
Resolve-AzureRmError [-Last] [<CommonParameters>]
25
22
```
26
23
27
24
## DESCRIPTION
28
-
29
25
Resolves and displays detailed information about errors in the current PowerShell session, including where the error
30
26
occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides
31
27
additional detail in debugging service issues, including complete detail about the request and server response
@@ -34,8 +30,7 @@ that caused the error.
34
30
## EXAMPLES
35
31
36
32
### Example 1: Resolve the Last Error
37
-
38
- ``` powershell
33
+ ```
39
34
PS C:\> Resolve-AzureRmError -Last
40
35
41
36
HistoryId: 3
@@ -60,10 +55,119 @@ HistoryId : 3
60
55
61
56
Get details of the last error.
62
57
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
+
63
168
## PARAMETERS
64
169
65
170
### -Error
66
-
67
171
One or more error records to resolve. If no parameters are specified, all errors in the session are resolved.
68
172
69
173
``` yaml
@@ -104,9 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
104
208
## OUTPUTS
105
209
106
210
### Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord
107
-
108
211
### Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord
109
-
110
212
### Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord
111
213
112
214
## NOTES
0 commit comments