title: Is there an equivalent of "this" in powershell?
body: <p>Basically I have this code:</p>
  
  <pre><code>$file = $web.GetFile("Pages/default.aspx")
  $file.CheckOut()
  </code></pre>
  
  <p>and I was wondering if there is anyway to use a pipe and the powershell equivalent of <code>this</code> to rewrite it as:</p>
  
  <pre><code>$web.GetFile("Pages/default.aspx") | $this.CheckOut()
  </code></pre>
  
  <p>When I try this I get the error:</p>
  
  <blockquote>
    <p>Expressions are only allowed as the first element of a pipeline.</p>
  </blockquote>
  
  <p>I also tried using <code>$_</code> instead of <code>$this</code> but got the same error.</p>