title: How to use TFS SnapIn "Add-TfsPendingChange -Edit" function in Powershell?
body: <p>A Powershell script currently contains:</p>
  
  <pre><code>$filePath = "C:\someDir\someFile.ext"
  Add-TfsPendingChange -Edit -Item &lt;QualifiedItemSpec[]&gt;
  </code></pre>
  
  <p>From the help files and documentation, I've not found how  to populate the <code>&lt;QualifiedItemSpec[]&gt;</code> parameter for the <code>-Item</code> switch properly.</p>
  
  <p>Can this be done using just the path in <code>$filePath</code> or do I need to add this pending change to a change set, or do I need to get a variable that contains the TFS work space and a variable that contains the change set to append an edit to?</p>
  
  <p><strong>Note:</strong> This is in a function, so I would want to do the equivalent of (ignoring the syntax and type failures):</p>
  
  <pre><code>function someFunction([string]$FileName, [TFSChangeSet]$ChangeSet)
  {
      #lines of code
      $filePath = [string]::Format("C:\someDir\{1}.ext", $FileName) 
      $ChangeSet.Edit($filePath)
  }
  </code></pre>
  
  <p>Also, these should remain as pending edits so I can inspect these files in VisualStudio before completing a checkin via VS</p>