title: How to use powershell variable in PowerShell.AddParameter method in C#?
body: <p>See my code below. The script creates the variable $backupFile. How can I use that variable in the next statement as value for the path parameter of the New-Item commend?</p>
  
  <pre><code>        using (var ps = PowerShell.Create())
          {
              ps.RunspacePool = _runspacePool;
              ps.AddScript("$backupFile = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(),'{0}.bak')".FormatInvariant(databaseName));
              ps.AddStatement();
              ps.AddCommand("New-Item")
                  .AddParameter("Force")
                  .AddParameter("ItemType", "File")
                  .AddParameter("Path", /* How to use $backupFile?? */));
              ps.Invoke();
          }
  </code></pre>