title: Create folder with current date as name in powershell
body: <p>I am writing a powershell script. I would like to know how to create a folder with current date as name. The folder name should be "yyyy-MM-dd" (acording to the .NET custom format strings).</p>
  
  <p>I know that to create folder I need to use this command:</p>
  
  <pre><code>New-Item -ItemType directory -Path "some path"
  </code></pre>
  
  <p>A possible solution could be (if I want to create the folder in the same directory as the script is:</p>
  
  <pre><code>$date = Get-Date
  $date = $date.ToString("yyyy-MM-dd")
  New-Item -ItemType directory -Path ".\$date"
  </code></pre>
  
  <p>Is there a way to chain the commands so I do not need to create the variable?</p>