##$parseDateTaken is not defined yet but will be before $DateDir is set.
##It's being used as a toggle to include or exclude the year directory.
$YearDir = "\" + {(Get-Date $parseDateTaken).Year}
...
$DateDir = $YearDir + "\" + $parseDateTaken
How can get the block of code to run when $YearDir is used? Right now it only interprets the whole thing as a string. I want to keep it a oneliner.