Deploying Word & PowerPoint Templates

Hi Guys

This is my first time using PSADT. I’m trying to Deploy Word & PowerPoint templates as well as setting the Outlook Default font on all our users machines.

This is the Installation command I have in Deploy-Application.ps1 :

Execute-ProcessAsUser -Path '$PSHOME\powershell.exe' -Parameters '-ExecutionPolicy Bypass -File "$dirFiles\TemplateCopy.ps1"'

This is the code I have in TemplateCopy.ps1 which is a script I’ve created to copy the templates and import the Reg file for Outlook fonts.

Copy-Item "$dirFiles\Templates\Normal.dotm" -Destination "$env:APPDATA\Microsoft\Templates\Normal.dotm”
Copy-Item "$dirFiles\Templates\NormalEmail.dotm" -Destination "$env:APPDATA\Microsoft\Templates\NormalEmail.dotm”
Copy-Item "$dirFiles\Templates\blank.potx" -Destination "$env:APPDATA\Microsoft\Templates\blank.potx”
reg import outlook-fonts.reg
Copy-Item "$dirFiles\Templates\installed.txt" -Destination "C:\Templates”

The App runs without any errors coming up but nothing happens, not templates change, no Outlook font changes.

I’m not sure where to start troubleshooting this, any help would be greatly appreciated.


Issue #1:
$env:APPDATA points to a folder the current user’s profile. What about the other users on the machine?
If you are launching PSADT via SCCM (or similar), $env:APPDATA will not point to the user currently logged in. Logging would help determine that but…

Copy-Item is a PS command that will not log or handle known quirks. Copy-File is a PSADT function that will log. If you use Copy-Item and it fails or copies to the wrong place (Your current issue, BTW), you will not be able to find out.

The Reg Import line might work but if your outlook-fonts.reg file has lines that start with [HKEY_CURRENT_USER… , you’ll have the same problem issue #1 but registry-based

Issues #1 and #3 require using Active-Setup.

In addtion to what the big orange guys says, your example code uses two different types of quotes, one of which PoSh does not like. The different colors in the lines are the first clue. May just be typo or copy/paste thing.