I’m tryin to write a script that gets info from active directory to create outlook signatures.
I’m able to get the info from ad, but the problem is that, when I do a -replace, it will only save the one for ‘CELL’, all the others above are not changed or saved in the text file. What am I doing wrong?
$readCode = Get-Content $code $readCode -replace 'NAME', $fullName | Set-Content -Path $code -Force $readCode -replace 'TITLE', $jobTitle | Set-Content -Path $code -Force $readCode -replace 'STREET ADDRESS', $streetAddress | Set-Content -Path $code -Force $readCode -replace 'ADDRESS', $address | Set-Content -Path $code -Force $readCode -replace 'PHONE', "Phone $deskPhone" | Set-Content -Path $code -Force $readCode -replace 'CELL', "Cell $cellPhone" | Set-Content -Path $code -Force
This is what the text file looks like, but I want every thing to change, not just ‘CELL’
NAME
TITLE
STREET ADDRESS
ADDRESS
PHONE
Cell 555-555-5555