OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Error when calling 3rd party executable from Powershell when using an IDE

  • Thread starter Thread starter Lucas
  • Start date Start date
L

Lucas

Guest
I have a PowerShell script that uses du.exe (Disk Usage originally from Sysinternals) to calculate the size of directories.

If I run du c:\Backup in the console, it works as expected, but the same line of code run in ISE or PowerGui gives the expected result plus the error

Code:
+ du <<<<  c:\backup
+ CategoryInfo          : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

Why is that? How do I avoid this error? I tried invoke-expression, using &, but no go.

Thanks for the help.
<p>I have a PowerShell script that uses du.exe (<a href="http://technet.microsoft.com/en-us/sysinternals/bb896651.aspx" rel="noreferrer">Disk Usage</a> originally from Sysinternals) to calculate the size of directories.</p>

<p>If I run <code>du c:\Backup</code> in the console, it works as expected, but the same line of code run in ISE or PowerGui gives the expected result plus the error </p>

<pre><code>+ du <<<< c:\backup
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
</code></pre>

<p>Why is that? How do I avoid this error? I tried invoke-expression, using <code>&</code>, but no go.</p>

<p>Thanks for the help.</p>
Continue reading...
 

Latest posts

Top