powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Invoke-TroubleshootingPack



NAME
Invoke-TroubleshootingPack

SYNOPSIS
Executes a troubleshooting pack in interactive or unattended mode to fix a problem, and then generates a results re
port.

SYNTAX
Invoke-TroubleshootingPack [-answer ] [-result ] [-unattend] [-pack] [
]


DESCRIPTION
The Invoke-TroubleshootingPack cmdlet runs a troubleshooting pack using the object that you get by using the Get-Tr
oubleshootingPack cmdlet.

This cmdlet can be run in two modes: interactive and unattended

-- In interactive mode, the questions are displayed at the console and the user can run resolvers selectively.

-- In unattended mode, Invoke-TroubleshootingPack runs in the background and, if it detects a root cause, it runs t
he corresponding resolvers in a predetermined order.

If a troubleshooting pack that is running in unattended mode needs answers to questions in order to run, it can get
the answers from the answer file that is associated with the troubleshooting pack. You can generate an answer file
for a troubleshooting pack by using the Get-TroubleshootingPack cmdlet.

Invoke-TroubleshootingPack can generate an optional Result Report and Debug Report that contains information about
the troubleshooting run, such as which root causes were found. The Debug Report can also contain exceptions that mi
ght have occurred during a troubleshooting pack execution. A troubleshooting pack might also add additional files,
such as event logs, during its execution to the report folder. To direct Invoke-TroubleshootingPack to generate a R
esult Report and Debug Report, use the Result parameter to specify the path to where the Result Report and Debug Re
port will be generated and the additional files added.


PARAMETERS
-answer
Directs Invoke-TroubleshootingPack to look in the specified answer file for answers to questions. Enter the abs
olute, relative, or UNC path to the XML answer file for the troubleshooting pack.

An answer file contains the answers to questions that a troubleshooting pack might ask during its execution. To
create an answer file, use the Get-TroubleshootingPack cmdlet.

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

-pack
Specifies the troubleshooting pack to run. Enter a variable that contains the troubleshooting pack object. To g
et the troubleshooting pack object, use the Get-TroubleshootingPack command.

You cannot submit a path as a value for the Pack parameter.

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

-result
Directs Invoke-TroubleshootingPack to generate the Result Report and Debug Report. Enter an absolute, relative,
or UNC path with no file name. If this parameter is not specified, then the Result Report and Debug Report wil
l not be generated.

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

-unattend []
Invoke-TroubleshootingPack in unattended mode. By default, it runs interactively.

Required? false
Position? named
Default value
Accept pipeline input? false
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
Microsoft.Windows.Diagnosis.Diagpack


OUTPUTS



NOTES


Invoke-TroubleshootingPack requires a DiagPack object. To get the object, use the Get-TroubleshootingPack cmdle
t.

If Invoke-TroubleshootingPack is running in unattended mode and the answer to a question is not found in the an
swer file, then Invoke-TroubleshootingPack will return an error to the troubleshooting pack, and the troublesho
oting pack can continue or stop executing.


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

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


This command gets a troubleshooting pack using the Get-TroubleshootingPack command and passes it to Invoke-Troubles
hootingPack to run. It uses a pipeline operator (|) to send the troubleshooting pack to the Invoke-TroubleshootingP
ack cmdlet, which runs the troubleshooting pack.

Because Invoke-TroubleshootingPack is run without parameters, it uses all of the default values. It runs interactiv
ely, does not use an answer file, and does not create a Result Report and Debug Report.





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

C:\PS>$aero = get-troubleshootingpack C:\Windows\Diagnostics\System\Aero
invoke-troubleshootingpack -pack $aero -result C:\DiagResult


This command uses the Invoke-TroubleshootingPack cmdlet to run a troubleshooting pack and generate a Result Report
and Debug Report.

The first command uses the Get-TroubleshootingPack cmdlet to get an object that represents the troubleshooting pack
at the specified location. It stores the object in the $aero variable.

The second command uses the Invoke-TroubleshootingPack cmdlet to run the troubleshooting pack. The Invoke-Troublesh
ootingPack command uses the Pack parameter to specify the troubleshooting pack in the $aero variable and the Result
parameter to specify the location of the Result Report and Debug Report.





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

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


This command runs a troubleshooting pack in unattended mode with an answer file.

The first command uses the Get-TroubleshootingPack cmdlet to get an object that represents the troubleshooting pack
at the specified location. It stores the object in the $aero variable. The command uses the Answer parameter of Ge
t-TroubleshootingPack cmdlet to generate an answer file.

The second command uses the Invoke-TroubleshootingPack cmdlet to run the troubleshooting pack in unattended mode. T
he command uses the Answer parameter of Invoke-TroubleshootingPack to direct the cmdlet to get answers to questions
from the answer file.






RELATED LINKS
Get-TroubleshootingPack