If you post code, please use the ‘Insert Code’ button. Please and thank you!

if ($newlocation=$oldlocation){<#stuff#>}

This does not work as ‘=’ is value assignment, not compare, it should be ‘-eq’

@browncoatsgt