Troubleshooting

Troubleshooting for PowerShell modules

Cmdlet Error handling and troubleshooting:

NOTE: Troubleshooting techniques are similar for all PowerShell modules.

Get more help for each cmdlet: Get-Help [-examples | -detailed | -full]

Troubleshoot-1

Common errors on executing cmdlet: Wrong Parameter Name – Check syntax for cmdlet using Get-Help

Troubleshoot-2

PowerShell logs

Log file location : C:\Users<alias>\AppData\Local\Dell<Module name>\PowerShell\logs

Use -Verbose and -Debug with PowerShell cmds

Sample log file content:

2021-04-15 10:25:13.5900 INFO Dell.Unity.Management.Service.SnapshotService.Restore Restore snapshot 38654709917 on APM00202932541 copyName: refreshCopySnap1
2021-04-15 10:25:13.5950 DEBUG Dell.Unity.Client.Client.ApiClient.LogRequest [	
    Method: POST	
    Resource: /api/instances/snap/{id}/action/restore	
    Parameters:		
        id: 38654709917		
        Application-Type: PowerShell/1.0		
        Set-Cookie: 		
        Content-Type: application/json		
        Accept: application/json		
        X-EMC-REST-CLIENT: true 		
        EMC-CSRF-TOKEN: ***REDACTED***JpZ3awUHuCnnDYpIb0uxLSvIoxnIFRyFwn4wBPswv7U8IWlV7knOk=		
        Body: class InlineObject215 {  CopyName: refreshCopySnap1}]
        2021-04-15 10:25:14.0897 DEBUG Dell.Unity.Client.Client.ApiClient.LogResponse [	StatusCode: NotFound
    Headers:
        X-Frame-Options: SAMEORIGIN		
        Strict-Transport-Security: max-age=63072000; includeSubdomains;		
        EMC-CSRF-TOKEN: ***REDACTED***JpZ3awUHuCnnDYpIb0uxLSvIoxnIFRyFwn4wBPswv7U8IWlV7knOk=		
        Pragma: no-cache		
        Content-Language: en-US		
        Keep-Alive: timeout=15, max=100		
        Connection: Keep-Alive		
        Transfer-Encoding: chunked		
        Cache-Control: no-cache, no-store, max-age=0		
        Content-Type: application/json; version=1.0;charset=UTF-8		
        Date: Thu, 15 Apr 2021 14:25:13 GMT		
        Expires: Thu, 01 Jan 1970 00:00:00 GMT		
        Server: Apache	
    Content: {"error":{"errorCode":131149829,"httpStatusCode":404,"messages":[{"en-US":"The requested resource does not exist. (Error code:0x7d13005)"}],"created":"2021-04-15T14:25:14.223Z"}}] 
2021-04-15 10:25:14.0897 FATAL Dell.Unity.PowerShell.Common.AbstractCmdlet.ThrowTerminatingError Dell.Unity.Client.Client.ApiException: Error calling SnapRestore: {"error":{"errorCode":131149829,"httpStatusCode":404,"messages":[{"en-US":"The requested resource does not exist. (Error Code:0x7d13005)"}],"created":"2021-04-15T14:25:14.223Z"}}
    at Dell.Unity.Client.Api.SnapApi.SnapRestoreWithHttpInfo(Boolean X_EMC_REST_CLIENT, String EMC_CSRF_TOKEN, String language, Nullable`1 timeout, String id, InlineObject215 body)
    at Dell.Unity.Client.Api.SnapApi.SnapRestore(Boolean X_EMC_REST_CLIENT, String EMC_CSRF_TOKEN, String language, Nullable`1 timeout, String id, InlineObject215 body)
    at Dell.Unity.Management.Service.SnapshotService.Handler.Restore(String id, String copyName)
    at Dell.Unity.Management.Service.SnapshotService.Restore(UnityArray array, String id, String copyName)
    at Dell.Unity.PowerShell.RestoreSnapshot.ProcessRecord()