Progress Bar (Write-Progress) in a Foreach statement and Getting Null problems

Welcome Forums General PowerShell Q&A Progress Bar (Write-Progress) in a Foreach statement and Getting Null problems

Viewing 1 reply thread
  • Author
    Posts
    • #250943
      Participant
      Topics: 6
      Replies: 14
      Points: 112
      Rank: Participant

      I’m try to get a Progress bar for a foreach loop. It starts over when last foreach name in variable $nic. I have atached both the section of the code that is not working and the complete script.

      Code Block that is not working

      Getting null when I try to import names from a cmdlet so I have to export to csv and pull back in for it to work.
      Codeblock

      Here is the complete script

      • This topic was modified 1 month, 1 week ago by grokkit.
    • #251363
      Participant
      Topics: 15
      Replies: 1776
      Points: 3,218
      Helping Hand
      Rank: Community Hero

      There are nested loops and the increment math is being done in the incorrect loop, the count for nics is inside the user loop. There are examples of nested loops in the docuementation, but it should be something like this:

Viewing 1 reply thread
  • You must be logged in to reply to this topic.