After beating my head against my desk for the last four hours (have mercy on me, it's Monday), it finally dawned on me to try this as a script and it works. However, when I'm writing, I generally just take my code and copy-and-paste into a PS window, and there's where I was having a problem. The ELSE part of the IF statement would just display as text, even if the IF was actually FALSE. Just wondering if anyone can explain why.
Powershell
if(test-path$objUser.HomeDirectory){Write-Host"$($objUser.HomeDirectory) already exists. Setting permissions..."-ForegroundColorRed}# else{#NEW-ITEM –path $objuser.HomeDirectory -type directory -forceWrite-Host"$($objUser.HomeDirectory) not there. Creating folder and setting permissions..."-ForegroundColorRed}The part that really gets me is that I only ran into this because I couldn't...