I want to read remote yaml
file present in remote azure vm
from my local machine using C# Runspace
.
I'm able to run Powershell
commands remotely using C# Runspace
but I'm not getting how to read yaml
file present in remote system like Azure VM
using Runspace
.
Below code is used to run powershell
command remotely from my local system.
using (Runspace remoteRunspace = RunspaceFactory.CreateRunspace(connectionInfo))
{
remoteRunspace.Open();
using (PowerShell powershell = PowerShell.Create())
{
powershell.Runspace = remoteRunspace;
powershell.AddScript("Get-Service");
}
}