I have simple My.DLL with code:
public class Class1
{
public static void WriteInConsole()
{
Console.WriteLine("LINE FROM DLL");
}
}
So, I open PS and type:
Import-Module 'C:\My.dll'
[My.Class1]::WriteInConsole()
Then I see output line.
LINE FROM DLL
Then I try to get this message in job. I type:
Start-Job -Name dllJob -ScriptBlock { Import-Module 'C:\My.dll'; [My.Class1]::WriteInConsole() }
receive-job -Name dllJob
I don't see message.
QUESTION:
What is wrong?
How to get output of console application in PowerShell Job?
Thank you!