我有下面的PowerShell腳本加載自定義的.NET DLL,它包含ScriptResult類,它是從VB.NET應用程序執行的實習生。Powershell - 將自定義對象返回給C#主機
Add-Type -Path $myLibPath
$result = New-Object TheLibrary.ScriptResult
在VB.NET應用程序,我想要得到的結果對象,但以下似乎沒有工作
'get the script result
Dim result As ScriptResult = run.SessionStateProxy.GetVariable("result")
什麼我不這樣做是否正確?
感謝第二個解決方案$ global:result works great – keyoke 2011-04-26 20:21:20
經過一番痛苦的搜索,我用第二個選項獲得了成功。非常感謝。 – 2013-07-05 02:26:48