title: Remove content, while keeping first top line powershell
body: <p>I have a sample.txt file where I would like to remove the content, except for it first top line.</p>
  
  <p>My sample.txt file looks like this: </p>
  
  <pre><code>1.dslkjfladsdjgmvjfgmldskbm;sldkvmg,;sdlmg;msj,;sdrl
  2.dlkjfsadfjmsal;jsalv;dsvmdsfkgmrg,pvtpvhtphb[h.[y
  3.fljsafckg,ksd,v;vyklt;vlkbmyulnmktr,ouf,f/.n,
  4.dflcajsmglsdv;ks'ítb;pjk.'gpjnuk. uo.hulmk,vgjhumk.'l
  </code></pre>
  
  <p>I would like the output result to look like following: </p>
  
  <pre><code>1.dslkjfladsdjgmvjfgmldskbm;sldkvmg,;sdlmg;msj,;sdrl
  </code></pre>
  
  <p>I have tried these commands but output clears the entire file. </p>
  
  <pre><code>Clear-Content C:\sample.txt | where { $_.length -gt 2}| Set-Content C:\sample.txt
  
  Clear-Content C:\sample.txt | Select -first 2 | Set-Content C:\sample.txt
  </code></pre>
  
  <p>Could someone please advise what am I missing?
  Thanks</p>