I have a PowerShell program with C# code inside. I want that the C# function will run in a new job. I tried this-
start-job -name Job1 -ScriptBlock {[MyProgram.Program]::Main()}
It looks like the job was executed but nothing happened.
start-job -name Job1 -ScriptBlock {
Add-Type -typedef @"
namespace MyProgram
{
//-----------------------------------------
public class Program
//-----------------------------------------
{
//-------------------------------------
public static void Main()
//-------------------------------------
{
// Your c# Code here
}
}
}
"@
[MyProgram.Program]::Main()
}