Foreach issues – only treating last domain on list

Welcome Forums General PowerShell Q&A Foreach issues – only treating last domain on list

Viewing 0 reply threads
  • Author
    • #235756
      Topics: 7
      Replies: 8
      Points: 88
      Rank: Member

      Hi Powershell!

      I am working on trying to make a Powershell / WinSCP script that can do the following:

      Consider a list of domains

      Delete a list of the same files, from each of these domains

      Upload new data to another location on these same domains.

      It sort of works by now, but, for some reason my foreach loop does not seem to quite get me.
      It seems to be only taking the last domain on the list, which is

      The ouput (written to host) is:

      Removing of file* succeeded
      Removing of file* succeeded
      Uploading to C:\Users\Dern\Desktop\REPLACEME\** …
      Uploading to C:\Users\Dern\Desktop\REPLACEME\** …
      Error: Exception setting “SessionLogPath”: “Object is disposed”

      Is seems to entirely skip, which is the first one.

      Also, can anyone enlighten me on why i get this exception error “object is disposed”?

      I really hope someone can help me the last bit here! 🙂

      Link to code:

      Best regards

Viewing 0 reply threads
  • You must be logged in to reply to this topic.