开发者

PowerShell Start-Job and Oracle

开发者 https://www.devze.com 2023-04-08 05:16 出处:网络
I have a ps script (say Set-Data.ps1) that calls a ps Run.ps1 with Start-Job as : Start-Job -FilePath Run.ps1 -ArgumentList 1, 2

I have a ps script (say Set-Data.ps1) that calls a ps Run.ps1 with Start-Job as : Start-Job -FilePath Run.ps1 -ArgumentList 1, 2

In Run.ps1 I have a line of code as:

$cs = ...;
Write-Output "1";
$开发者_JAVA技巧conn = New-Object Oracle.DataAccess.Client.OracleConnection($cs);
$conn.Open();

Write-Output "2";

From cmd prompt I run Set-Data.ps1.

The program never prints "2" from line ==> Write-Output "2";

The job stats keeps showing as Running.

Why is this so?

0

精彩评论

暂无评论...
验证码 换一张
取 消