title: How to get leading spaces instead of zeros in Powershell?
body: <p>Somewhere in my script I'm writing a folderstructure to Host with the number of files in each folder [1]:</p>
  
  <pre><code>$FolderName = "BAR"
  $ItemCount  = "{0:000}" -f 7
  
  Write-Host $ItemCount $FolderName
  </code></pre>
  
  <p>which would output something like [2]:</p>
  
  <pre><code>007 BAR
  044 BAZ
  311 FOO
  </code></pre>
  
  <p>What I actually want is [3]:</p>
  
  <pre><code>  7 BAR
   44 BAZ
  311 FOO
  </code></pre>
  
  <p>I don't want to use a custom Powershell object because it would output over the full width of the console [4]:</p>
  
  <pre><code>Folder                                                       Itemcount
  ------                                                       ---------
  BAR                                                                  7
  BAZ                                                                 44
  FOO                                                                311
  </code></pre>
  
  <p>I would like an output like [5]:</p>
  
  <pre><code>Folder   ItemCount
  ------   ---------
  BAR              7
  BAZ             44
  FOO            311
  </code></pre>
  
  <p>So close together which makes it much more readable. But I chose my solution (ItemCount in from of FolderName) as a second best option because I could not get this to work.</p>
  
  <p>How can I get an output like in [3] or [5]?</p>