VMware Cloud Community
Mallik7
Enthusiast
Enthusiast
Jump to solution

Is there a script available to determine LUN / datastore GPT corruption?

The backup jobs are getting failed due to GPT corruption (primary partition table) on the datastores.

Ran a command to check the status. However, we would like to check our entire environment to know how many datastores has similar issue.

so, is there a PowerCLI script available to determine LUN / datastore GPT corruption - Cluster wise or whole vCenter ? Could you please help here....!

48 Replies
LucD
Leadership
Leadership
Jump to solution

If the the New-SshSession fails due to incorrect credentials, you should also see an error message like "New-SSHSession : Permission denied (keyboard-interactive)."

Do you get that kind of message?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Mallik7
Enthusiast
Enthusiast
Jump to solution

Yes, I remember seeing this message.
However, I didn't capture that. Otherwise, I would have attached here for your review.

I guess, when authentication failed or unable to connect to any host, the previous result which is loaded in the defined variable, adding against to the "connection failed host".

Can you please help to correct this...

0 Kudos
Mallik7
Enthusiast
Enthusiast
Jump to solution

here is what I see when I run the script -

New-SSHSession : Session operation has timed out

At C:\Script\GPT\GPTcorrupt.ps1:19 char:15

+ ...  $session = New-SSHSession -ComputerName $esx.Name -Credential $cred  ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationTimeout: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], SshOperationTimeoutException

    + FullyQualifiedErrorId : SSH.NewSshSession

New-SSHShellStream : Cannot bind argument to parameter 'SSHSession' because it is null.

At C:\Script\GPT\GPTcorrupt.ps1:21 char:45

+    $stream = New-SSHShellStream -SSHSession $session -TerminalName tt ...

+                                             ~~~~~~~~

    + CategoryInfo          : InvalidData: (:) [New-SSHShellStream], ParameterBindingValidationException

    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,New-SSHShellStream

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

0 Kudos
Mallik7
Enthusiast
Enthusiast
Jump to solution

adding more information about the errors -

New-SSHSession : Session operation has timed out

At C:\Script\GPT\GPTcorrupt.ps1:19 char:15

+ ...  $session = New-SSHSession -ComputerName $esx.Name -Credential $cred  ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationTimeout: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], SshOperationTimeoutException

    + FullyQualifiedErrorId : SSH.NewSshSession

New-SSHShellStream : Cannot bind argument to parameter 'SSHSession' because it is null.

At C:\Script\GPT\GPTcorrupt.ps1:21 char:45

+    $stream = New-SSHShellStream -SSHSession $session -TerminalName tt ...

+                                             ~~~~~~~~

    + CategoryInfo          : InvalidData: (:) [New-SSHShellStream], ParameterBindingValidationException

    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,New-SSHShellStream

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

   + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

   + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

New-SSHSession : Session operation has timed out

At C:\Script\GPT\GPTcorrupt.ps1:19 char:15

+ ...  $session = New-SSHSession -ComputerName $esx.Name -Credential $cred  ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : OperationTimeout: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], SshOperationTimeoutException

    + FullyQualifiedErrorId : SSH.NewSshSession

New-SSHShellStream : Cannot bind argument to parameter 'SSHSession' because it is null.

At C:\Script\GPT\GPTcorrupt.ps1:21 char:45

+    $stream = New-SSHShellStream -SSHSession $session -TerminalName tt ...

+                                             ~~~~~~~~

    + CategoryInfo          : InvalidData: (:) [New-SSHShellStream], ParameterBindingValidationException

    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,New-SSHShellStream

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "WriteLine" with "1" argument(s): "Cannot access a disposed object.

Object name: 'ShellStream'."

At C:\Script\GPT\GPTcorrupt.ps1:47 char:6

+      $stream.WriteLine("partedUtil getptbl /vmfs/devices/disks/$dev")

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : ObjectDisposedException

Exception calling "ReadLine" with "0" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:49 char:6

+      $stream.ReadLine() | Out-Null              # Drop command echo

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

Exception calling "Expect" with "1" argument(s): "Object reference not set to an instance of an object."

At C:\Script\GPT\GPTcorrupt.ps1:51 char:6

+      $result = $stream.Expect([regex]'] $')   # Wait for prompt & rea ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : NullReferenceException

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That 1st error seems to indicate a timeout.

Which probably means that the ESXi node can not be reached or does not answer on the SSH request.

Does SSH to that ESXi node work?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Mallik7
Enthusiast
Enthusiast
Jump to solution

how to determine which host really throwing that error? based on that I can check.

I'm running the script connect to a production vCenter which has about 700+ ESXi hosts running. The script is not clearly indicating in the result against each host, which host is not able to connect.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You can include one or more Write-Host lines while debugging.
For example

Get-VMHost -PipelineVariable esx |

ForEach-Object -Process {

  Write-Host "Checking ESXi node $($esx.Name)"


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Mallik7
Enthusiast
Enthusiast
Jump to solution

does this code help to know which host is not able to connect or unresponsive ?

and where to add this code, please advise....

0 Kudos
LucD
Leadership
Leadership
Jump to solution

It will display the name of the ESXi it is looking at.

That way we can tell for which ESXi node the issue is encountered.

The only new line is the one with Write-Host, I added the other 2 lines so you could easily find where the insert it.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos