New folder for everyday with PowerShell.
Question : How to create a folder for everyday of the year using PowerShell?
Answer: Everyday folders creation for an year can be achieved by many methods. One of the method mentioned here is by getting current date\year and uses for-each loop to create the new folder in specified target path.
$year = [datetime]::Now.Year #Gets current year.Can replace $year=2019 or any year.
$inpath = “$env:USERPROFILE\my documents\$year\” #Specify the path of creation
$count=0
1..12 | ForEach-Object {
$count++
$month=([cultureinfo]::InvariantCulture).DateTimeFormat.GetAbbreviatedMonthName($count)
New-Item -ItemType directory -name $month -Path $inpath -Force }