title: How to create folders dynamically using PowerShell?
body: <p>Requirement: I am trying to create the BKP folder in 10 server using the below code but some how it is not creating the new folder in servers.</p>
  
  <pre><code>foreach ($instance in Get-Content "C:\servers\List.txt")
  {
      $local = Get-Location;
      $final_local = "C:\BKP";
  
      if (!$local.Equals("C:\"))
      {
          cd "C:\";
          if ((Test-Path $final_local) -eq 0)
          {
              mkdir $final_local;
              cd $final_local;
          }
  
          ## if path already exists
          ## DB Connect
      }
  }
  </code></pre>