locked
Problems using Get-TroubleshootingPack RRS feed

  • Question

  • I am trying to use Get-Troubleshooting pack in Windows 2016 to create an answer file to allow me to automate one particular fix.

    If I do this:

    $TSPackfolders = Get-ChildItem -Path C:\Windows\diagnostics\system -Directory
    $TSPacks = foreach ($TSPack in $TSPackfolders) {
                  Get-TroubleshootingPack -Path $TSPack.FullName}
    # Start a troubleshooting pack
    $TsPack = $TSPacks | Where id -eq 'WindowsUpdateDiagnostic'
    $TsPack | Invoke-TroubleshootingPack

    # get answer files
    Get-TroubleshootingPack -Path $TSPack.path `
                  -AnswerFile c:\Answers.xml

    But when I do this, I don't manage to actually go through the same questions as when running the troubleshooter natively.

    Also when I run the TSPack using the answer file, nothing is automated?

    Does using the cmdlet actually property create the answer file?


    Thomas Lee <DoctorDNS@Gmail.Com>



    • Edited by Thomas Lee Wednesday, July 19, 2017 9:22 AM
    Tuesday, July 18, 2017 7:06 PM

Answers

  • Simple:

    Get-TroubleshootingPack -Path C:\Windows\diagnostics\system\WindowsUpdate | Invoke-TroubleshootingPack


    \_(ツ)_/

    • Marked as answer by jrv Tuesday, April 2, 2019 5:09 AM
    Tuesday, July 18, 2017 7:26 PM

All replies

  • Simple:

    Get-TroubleshootingPack -Path C:\Windows\diagnostics\system\WindowsUpdate | Invoke-TroubleshootingPack


    \_(ツ)_/

    • Marked as answer by jrv Tuesday, April 2, 2019 5:09 AM
    Tuesday, July 18, 2017 7:26 PM
  • First, thanks for the answer, although the answer doesn't address the issue.

    I know how to RUN the troubleshooter. If you do try this, you run through an interactive script. I want to automate that. The way to go that is meant to be by using Get-Troubleshootingpack, specifying an -AnswerFIle. This is supposed to walk you through the troubleshooter and capture your answers to an XML file. Then you can use Invoke-TroubleshootingPack with the -Answerfile Parameter, then pass through that XML file.

    The thing is, then I try to create the answer file, the troubleshooter takes me through a different path and a different set of questions. If i use the generated answer file, it does not answer the questions,and I get prompted for other answers. 

    And some of the other troubleshooters generate pretty random results trying to generate the answer files and automate running the tspack.

    Can you try running the WU update, trying to generate the answer file, then run the TSpack with that file?


    Thomas Lee <DoctorDNS@Gmail.Com>

    Tuesday, July 18, 2017 7:32 PM
  • Read the help as it will tell you how to specify an answer file and how to option the CmdLet.


    \_(ツ)_/

    Tuesday, July 18, 2017 7:41 PM
  • Did you actually read my reply?

    I know how you are supposed to speciy answer files, and I know how answer files are meant to be created. I do not need help with that. 

    What I do need help with is making it work.

    Again - please read my reply, and try out what I am doing to see for your self. Then feel free to provide advice that is relevant.




    Thomas Lee <DoctorDNS@Gmail.Com>

    Tuesday, July 18, 2017 9:30 PM
  • What is it that doesn't work?

    Read the help as it will get you going in the right direction:

    Get-TroubleshootingPack -Path C:\Windows\diagnostics\system\WindowsUpdate |
       Invoke-TroubleshootingPack -AnswerFile c:\test\test.ans


    \_(ツ)_/

    Tuesday, July 18, 2017 9:48 PM
  • Did you actually READ my two longer posts? I stated what is not working and how you can verify it.

    As an aside, when I post answers to questions, I test them to see whether I can reproduce the issue. If I can't reproduce I say so and offer advice. I try not to tell the user to just read the help file or similar.  For what it's worth, I am one of many contributors to the very help file you want me to read. I suspect I know the contents considerably better than most. So that answer was not a helpful one.

    I suggest you read what I wrote above. I think it sets out the issue, how I am approaching it and what I am seeing. Feel free to try to verify it.


    Thomas Lee <DoctorDNS@Gmail.Com>

    Tuesday, July 18, 2017 9:57 PM
  • If you would actually take the time to carefully read the help you would understand what is happening.  THe "Get" creates the answer file.  "Invoke" executes the diagnostic and returns the results.

    A simple method is:

    Get-TroubleshootingPack -Path C:\Windows\diagnostics\system\WindowsUpdate  -Answer myanswers.xml
    Get-TroubleshootingPack -Path C:\Windows\diagnostics\system\WindowsUpdate |
         Invoke-TroubleshootingPack -Answer myanswers.xml
    WindowsUpdate has no options.


    \_(ツ)_/


    • Edited by jrv Tuesday, July 18, 2017 10:05 PM
    Tuesday, July 18, 2017 10:05 PM
  • Note that some of these diagnostics will not work correctly on the "Creators Update".

    \_(ツ)_/

    Tuesday, July 18, 2017 10:10 PM
  • Note that some of these diagnostics will not work correctly on the "Creators Update".

    \_(ツ)_/

    As the question notes, I am using Windows Server 2016.

    So far, I have tested around 10 of the TS Packs. NONE of them work correctly with respect to generating the answer file.  I have also tested this on multiple Server 2016 systems and the issue seems to be consistent. 

    It appears that the feature to create an answer file is broken in Server 2016. 


    Thomas Lee <DoctorDNS@Gmail.Com>

    Wednesday, July 19, 2017 9:24 AM
  • How are you creating the answer file?

    \_(ツ)_/

    Wednesday, July 19, 2017 2:38 PM
  • As per the cmdlet help information.

    Thomas Lee <DoctorDNS@Gmail.Com>

    Wednesday, July 19, 2017 2:52 PM
  • I have no issue creating an answer file like this:

    Get-TroubleshootingPack -PathC:\Windows\diagnostics\system\WindowsUpdate  -Answermyanswers.xml

    Of course WU does not have an answer file because it has no options.


    \_(ツ)_/


    • Edited by jrv Wednesday, July 19, 2017 2:59 PM
    Wednesday, July 19, 2017 2:59 PM
  • The idea of an answer file is to take the answers we would give interactively, save them ALL in XML, then allow the troubleshooting pack to do the operations using the answer file. That is not what is happening.

    If you run the WU diag interactively you get one set of prompts. you do NOT see those when creating the answer file. 

    I think this is broken in Server 2016. 


    Thomas Lee <DoctorDNS@Gmail.Com>

    Wednesday, July 19, 2017 3:10 PM
  • I will note that some of the diagnostics are broken since recent updates.  If this is an issue then you can post in UserVoice but the fixes will not likely come quickly. 


    \_(ツ)_/

    Wednesday, July 19, 2017 3:18 PM
  • Thanks for the confirmation that the diagnostics are borked.

    After testing, it looks like all relevant troubleshooting packs do not work to generate an answer file either. 

    Bottom line: the answer feature is broken in the latest versions of WIndows client and server. From what the moderator says, it appears that this feature unsupported thus to get a fix, we have to raise a user voice query.

    That answers my question, although I have to say I find the answer sad.


    Thomas Lee <DoctorDNS@Gmail.Com>



    • Edited by Thomas Lee Wednesday, July 19, 2017 4:36 PM
    Wednesday, July 19, 2017 4:34 PM
  • Hello,

    I am facing this same issue.  Would you happen to know if there has been any fix or workaround for this bug yet?

    https : //github.com/MicrosoftDocs/windows-powershell-docs/issues/84

    Any additional update would be greatly appreciated!


    Tuesday, April 2, 2019 4:50 AM
  • Hello,

    I am facing this same issue.  Would you happen to know if there has been any fix or workaround for this bug yet?

    https : //github.com/MicrosoftDocs/windows-powershell-docs/issues/84

    Any additional update would be greatly appreciated!



    I recommend opening your own question,  This question is old and closed.

    \_(ツ)_/

    Tuesday, April 2, 2019 5:09 AM