Get-TroubleshootingPack

Gets information about a troubleshooting pack and can generate an answer file.
Get-TroubleshootingPack [-answer <string>] [-path*] <string> [<CommonParameters>]

The Get-TroubleshootingPack cmdlet gets information about a troubleshooting pack, including the name of the troubleshooting pack publisher, the version of the pack, a list of root causes, the set of resolvers that can be run, and the list of questions that the troubleshooting pack might ask during execution.

The cmdlet can also generate an answer file that contains the responses to the set of questions that the troubleshooting pack might ask during its execution.

A troubleshooting pack is used to troubleshoot and resolve software problems. For more information, please see the relevant MSDN documentation.

Parameters
-answer <string>

Directs Get-TroubleshootingPack to generate an answer file at the specified location. Enter a relative, absolute, or UNC path and a file name with an xml file extension. If you omit the path, the answer file will be generated in the current working directory. If you omit this parameter, Get-TroubleshootingPack does not generate an answer file.

When you use the Answer parameter, Get-TroubleshootingPack prompts you for an answer to each question that is specified in the troubleshooting pack and writes the answer you provide to the answer file at the specified location.

The answer file contains answers to questions that a troubleshooting pack might ask. You can pipe the answer file to the Invoke-TroubleshootingPack cmdlet to enable unattended execution of the troubleshooting pack.

-path <string>

  • This value is required
  • Accepts pipeline input ByValue

Specifies the relative, absolute, or UNC path to the troubleshooting pack. This parameter is required. You can type a path or pipe a path to Get-TroubleshootingPack.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Outputs

Microsoft.Windows.Diagnosis.Diagpack

This object contains information about the troubleshooting pack.

Examples
  1. This command gets information about the troubleshooting pack at the specified location:
    C:PS> get-troubleshootingpack -path C:WindowsDiagnosticsSystemAero
    
  2. This example shows how to get to a specific root cause in the RootCauses property, which contains a list (an array) of root causes:
    C:PS> $aero = get-troubleshootingpack C:WindowsDiagnosticsSystemAero
    $aero.Rootcauses[2]
    

    The first command gets information about the troubleshooting pack at the specified location and stores it in the $aero variable. The second command uses array notation to get the third root cause in the pack.

  3. This example shows how to use Get-TroubleshootingPack to generate an answer file for a troubleshooting pack:
    C:PS> $aero = get-troubleshootingpack C:WindowsDiagnosticsSystemAero -answer AeroAnswerFile.xml
    

    This command gets information about the troubleshooting pack at the specified location and stores this information into the $aero variable. It also generates an answer file by prompting for an answer to each interaction that is defined in the troubleshooting pack.

  4. This example shows how to get to a specific resolver for a specific root cause:
    C:PS> $aero = get-troubleshootingpack C:WindowsDiagnosticsSystemAero
    $aero.Rootcauses[2].Resolution[0]
    

    The first command gets information about the troubleshooting pack at the specified location and stores it in the $aero variable. The second command uses array notation to get the first resolver of the third root cause in the pack.

Additional Notes
 You can pipe the output from Get-TroubleshootingPack to the Invoke-TroubleshootingPack cmdlet. For more 
 information, type "get-help invoke-troubleshootingpack".

 The default output from the cmdlet shows basic information about the pack: Pack ID, Publisher name, Pack 
 version, Pack name and description, privacy information link, execution environment requirements, and whether 
 or not the troubleshooting pack contains static or dynamic interactions. However, you can use the Get-Member 
 command to see all of the properties and methods of the DiagPack object and use the Select-Object and 
 formatting cmdlets to customizeits display.

 To access root causes, use the RootCauses array property of the object that Get-TroubleshootingPack returns; 
 each RootCause object can be accessed by specifying an array index.

 To access resolvers, use the Resolution array property of the RootCause object. To access each resolver, 
 specify an array index, such as $_.RootCauses[0].Resolutions[0] to access the first resolver for the first 
 root cause. 

 The Interactions property of the DiagPack object contains questions that the troubleshooting pack can be ask 
 during execution. To access a question, use an array index, such as $_.Interactions[1] to access the second 
 question (arrays are zero-based).

 The answers to questions that a troubleshooting pack might ask during execution can be text, single-select or 
 multi-select, and static (the answer never changes) or dynamic (the answer is generated at run-time). To 
 access the single-select and multi-select static answers, use the Choices array property of the Interactions 
 property.
Related Links

Invoke-TroubleshootingPack