Have a look at this code. I've annotated the important changes with comments. If you're going to use PowerShell, you should also get used to using the pipeline. There's no benefit to creating an array of objects (e.g., computers) and then use a "foreach" to process that array. With a pipeline you can start processing the items as they are returned from the Get-ADComputer. With only a small number of array elements the difference wouldn't be noticeable, but if you're working with thousands of items it takes time to return the results and build the array before you begin processing the information.
Start-Transcript -Path c:\temp\Transcript.txt
$group = get-adgroup 'OU - Group'
Get-ADComputer -Filter * -SearchBase "ou=Devices,ou=test,ou=Root,dc=domain,dc=local" -Properties memberof | # Add -Properties parameter
ForEach-Object {
$computer = $_
if($computer.memberOf -contains $group.distinguishedname){ # memberof is a list of distinguishednames,so look for group's DN in that list
Write-Host "$($computer.Name) is already in $($group.name)"
}else{
Get-ADGroup -Filter {name -like 'location - *'} | # if this filter doesn't work, replace the "{" and "}" characters with double-quotes
Remove-ADGroupMember -Members $computer.distinguishedname -WhatIf # I'd work with DNs to avoid ambiguity
Add-ADGroupMember -Identity $group.distinguishedname -Members $computer.distinguishedname -WhatIf # I'd work with DNs to avoid ambiguity
}
}
Stop-Transcript