powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-TroubleshootingPack



NAME
Get-TroubleshootingPack

SYNOPSIS
Gets information about a troubleshooting pack and can generate an answer file.

SYNTAX
Get-TroubleshootingPack [-answer ] [-path] []


DESCRIPTION
The Get-TroubleshootingPack cmdlet gets information about a troubleshooting pack, including the name of the trouble
shooting 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 troublesho
oting 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
Directs Get-TroubleshootingPack to generate an answer file at the specified location. Enter a relative, absolut
e, or UNC path and a file name with an xml file extension. If you omit the path, the answer file will be genera
ted 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 s
pecified in the troubleshooting pack and writes the answer you provide to the answer file at the specified loca
tion.

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

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-path
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.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
Microsoft.Windows.Diagnosis.Diagpack


NOTES


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

The default output from the cmdlet shows basic information about the pack: Pack ID, Publisher name, Pack versio
n, 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 t
o 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; ea
ch 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, specif
y 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 du
ring execution. To access a question, use an array index, such as $_.Interactions[1] to access the second quest
ion (arrays are zero-based).

The answers to questions that a troubleshooting pack might ask during execution can be text, single-select or m
ulti-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.


-------------------------- EXAMPLE 1 --------------------------

C:\PS>get-troubleshootingpack -path C:\Windows\Diagnostics\System\Aero


This command gets information about the troubleshooting pack at the specified location.





-------------------------- EXAMPLE 2 --------------------------

C:\PS>$aero = get-troubleshootingpack C:\Windows\Diagnostics\System\Aero
$aero.Rootcauses[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.

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





-------------------------- EXAMPLE 3 --------------------------

C:\PS>$aero = get-troubleshootingpack C:\Windows\Diagnostics\System\Aero -answer AeroAnswerFile.xml


This example shows how to use Get-TroubleshootingPack to generate an answer file for a troubleshooting pack.

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 de
fined in the troubleshooting pack.





-------------------------- EXAMPLE 4 --------------------------

C:\PS>$aero = get-troubleshootingpack C:\Windows\Diagnostics\System\Aero
$aero.Rootcauses[2].Resolution[0]


This example shows how to get to a specific resolver for a specific root cause.

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






RELATED LINKS
Invoke-TroubleshootingPack