Check this out:
$today=get-date -format yyyMMdd
$today
$yesterday=(get-date).adddays(-1)|%{
if($_.month -lt 10){$month=[string]0+$_.month}else{$month=$_.month}
if($_.day -lt 10){$day=[string]0+$_.day}else{$day=$_.day}
[string]$_.year+[string]$month+[string]$day
}
$yesterday
"$yesterday".replace($yesterday,$today)
Using the format you're looking for to calculate yesterday is a PAIN! Maybe there's an easier though.
That should help you out...