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