Problem with Powershell

This is the script:

foreach ($name in $dir)
$user = Get-QADUser -SamAccountName $
if (!$user) {
write-Host $
$path = “x:\”+$
$path2 = “x:\_old homedirs\”+$
move-item $path $path2
rename-item -Newname ($” Archived at “+$a)

The move works fine, but the rename gives me an error.
I’ve also tried this:

rename-item -path (“x:\_old homedirs\”+$ -Newname ($” Archived at “+$a)

But I get the same error. The error is:

Rename-Item : Cannot rename because the target specified represents a path or device name.