I am work on an asp.net mvc web application and i am calling powershell scripts inside my web application, as follow:-
var shell = PowerShell.Create();
string PsCmd = "add-pssnapin VMware.VimAutomation.Core; $vCenterServer = '" + vCenterName + "';$vCenterAdmin = '" + vCenterUsername + "' ;$vCenterPassword = '" + vCenterPassword + "';" + System.Environment.NewLine;
PsCmd = PsCmd + "$VIServer = Connect-VIServer -Server $vCenterServer -User $vCenterAdmin -Password $vCenterPassword;" + System.Environment.NewLine;
PsCmd = PsCmd + "Get-VMHost " + System.Environment.NewLine;
shell.Commands.AddScript(PsCmd);
var results = shell.Invoke();
now I will get the following values :-
so can anyone adivce how i can access values such as Build, or loop thorugh thr NetworkInfo ? thanks
EDIT
full trace picture:-


Buildthere for you to use?dynamickeyword.