PowerShell - Create folder with tomorrow's date as the name, but skip weekends
<p>Every evening I need to run a batch file to convert some txt files into PDF and move them into a folder with the current day's date as the folder name. That's the easy part. </p>

<p>The harder part is, as part of the same batch file, I also need to create a folder with the following day's date as the folder name but I need to skip weekends.  So if I run the script on a Friday, I need it to automatically name the folder with Monday's date instead of Saturday's.</p>

<p>My script so far looks like this:</p>

<pre><code>$tomorrow = [DateTime]::Today.AddDays(+1).ToString("dd-MM-yyyy")

$folder = "S:\DailyReports\" + "$tomorrow"

New-Item -Path $tomorrow -ItemType directory

$today = (Get-Date -Format dd-MM-yyyy)

$folder = "S:\DailyReports\" + "$Today"

New-Item -Path $folder -ItemType directory
</code></pre>

<p>This works absolutely fine for Monday-Thursday evenings, but if I were to run this on a Friday evening, it'll simply create a folder with Saturday's date instead of Monday's.</p>