var shell = PowerShell.Create();
var sxr = File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1");
// Add the script to the PowerShell object
shell.Commands.AddScript(File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1"));
// Execute the script
var results = shell.Invoke();
var middleIndex = Math.Round((decimal)(results.Count()/ 2));
foreach (var qq in results )
{
var a = qq.Members["InputObject"];
var b = qq.Members["SideIndicator"];
}
<Reference Include="System.Management.Automation" />
$book1=Get-Content "C:\Users\vinod\Desktop\planes.xml"
$book1=$book1 | Foreach {$_.Trim()}
$book2=Get-Content "C:\Users\vinod\Desktop\planes2.xml"
$book2=$book2 | Foreach {$_.Trim()}
Compare-Object $book1 $book2
var sxr = File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1");
// Add the script to the PowerShell object
shell.Commands.AddScript(File.ReadAllText(@"C:\Users\vinod\Desktop\demo.ps1"));
// Execute the script
var results = shell.Invoke();
var middleIndex = Math.Round((decimal)(results.Count()/ 2));
foreach (var qq in results )
{
var a = qq.Members["InputObject"];
var b = qq.Members["SideIndicator"];
}
<Reference Include="System.Management.Automation" />
$book1=Get-Content "C:\Users\vinod\Desktop\planes.xml"
$book1=$book1 | Foreach {$_.Trim()}
$book2=Get-Content "C:\Users\vinod\Desktop\planes2.xml"
$book2=$book2 | Foreach {$_.Trim()}
Compare-Object $book1 $book2