none
how to tell if a powershell command is still running RRS feed

  • Question

  • for some reason i have a command that runs for a very long time (around 3) in which it starts to output what i've expected roughly once it reaches this point. i know the command works fine if i specify a small group however i don't know why it takes this long. the command itself is beside the point. what i want to ask is do commands themselves appear in some sort of list (like get-process) inside powershell? i'm wanting to do a while statement on the command so that it can output a counter while that command is still executing.
    Thursday, May 3, 2018 8:41 AM

Answers

  • I like to add a progress bar to my larger scripts to monitor progress.

    https://blogs.technet.microsoft.com/heyscriptingguy/2011/01/29/add-a-progress-bar-to-your-powershell-script/


    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.

    Thursday, May 3, 2018 8:44 AM

All replies

  • I like to add a progress bar to my larger scripts to monitor progress.

    https://blogs.technet.microsoft.com/heyscriptingguy/2011/01/29/add-a-progress-bar-to-your-powershell-script/


    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.

    Thursday, May 3, 2018 8:44 AM
  • Try this:

    $global:i = 1
    Get-Process | select @{n='Counter';e={$global:i++;$i}},Processname


    \_(ツ)_/

    Thursday, May 3, 2018 9:22 AM