title: Folder/Directory Creation on Deployment Targets
body: <p>I am deploying a small script to the target PC using Octopus Deploy but the script is not generating a new folder on the target machine. Is there a problem in my code or is it a problem with the deployment setup?</p>
  
  <pre><code>using System;
  using System.IO;
  
  class FolderCreation
  {
      public static void Main()
      {
          string _basePath = @"c:\OD_Test";
          try
          {
              string dateFolder = DateTime.Now.ToString("yyyy-MM-dd");
              string path = $"{_basePath}\\{dateFolder}";
  
              System.IO.Directory.CreateDirectory(path);
          }
          catch (Exception ex)
          {
               Console.WriteLine("The process failed: {0}", ex.ToString());
          }
      }
  }
  </code></pre>