powergui

$MyInvocation.MyCommand.Path is $null in PowerGUI script editor

北战南征 提交于 2020-01-14 10:28:26
问题 When trying to debug my powershell script in the powerGUI script editor (2.0.0.1082) the $MyInvocation.MyCommand.Path is $null. It works when running the script via powershell. Running it in Powershell_ise.exe (on one of our servers) also works fine. Have anyone else had the same problem or know what's wrong? Here's my powershell version: Name Value ---- ----- CLRVersion 2.0.50727.4927 BuildVersion 6.1.7600.16385 PSVersion 2.0 WSManStackVersion 2.0 PSCompatibleVersions {1.0, 2.0}

Can Powershell Receive-Job return a DataSet?

試著忘記壹切 提交于 2020-01-02 05:18:11
问题 Background Info : I have an application that makes several SQL connections to multiple databases which currently takes a very very long time to execute. Powershell (.NET) will wait for each proceeding " SQL-GET " function to finish before it can fire off the next. I am under the impression I can speed this app up dramatically by firing each " SQL-GET " function in their own background job simultaneously!I will then retrieve the data from each job as they finish. Ideally as a DataSet system

Why does “F5 - Start Debugging” ignore breakpoints in PowerGUI?

て烟熏妆下的殇ゞ 提交于 2019-12-12 16:09:47
问题 I'm not sure if I'm being a bit thick, but I have a simple script with three lines: $iis = 90000 $name = "somesite" Write-Host("Values are: $iis and $name") If I set a breakpoint on any of these lines and hit the play button (F5 - start debugging) the script runs but the breakpoints are ignored. If I start the script with F11 (step into) I can step through just fine, however hitting F5 to run to the next breakpoint again causes PowerGUI to ignore the breakpoints The script I'm working on is

Can Powershell Receive-Job return a DataSet?

一曲冷凌霜 提交于 2019-12-05 12:04:09
Background Info : I have an application that makes several SQL connections to multiple databases which currently takes a very very long time to execute. Powershell (.NET) will wait for each proceeding " SQL-GET " function to finish before it can fire off the next. I am under the impression I can speed this app up dramatically by firing each " SQL-GET " function in their own background job simultaneously!I will then retrieve the data from each job as they finish. Ideally as a DataSet system object. The Issues : When retrieving the data from the background job, I can ONLY manage to get a System

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

雨燕双飞 提交于 2019-11-27 11:11:16
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 + 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. To avoid this you can redirect stderr to null e.g.: du 2> $null Essentially the console

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

ぃ、小莉子 提交于 2019-11-26 15:25:24
问题 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 + 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