I am trying to rename a file in \appdata\Roaming\ for each user profile on a pc. The command I am trying this, but not working. What am I doing wrong? Please help.
$old = 'C:\users\*\AppData\Roaming\SAP\Common\test.txt'
$rename = 'C:\users\*\AppData\Roaming\SAP\Common\test-old.txt'
Get-ChildItem $rename | ForEach-Object {Rename-Item -Path $old -NewName $_ -Force}