Error in powershell script

Referencing old no longer existing variable