Showing posts with label File Copy. Show all posts
Showing posts with label File Copy. Show all posts

Friday, May 6, 2016

Powershell Script: Copy files from multiple source directories



While you can create a package or application that copies config files out to your clients after an install, there may be times when it's easier to just use a PowerShell script to copy configuration files to your client machines.

This was true in our case where we had to copy files from different source directories depending on the name of the computer.  In our case, we had to copy a different configuration file to C:\Program Files (x86)\application\ depending on which site that computer was at.  Our computers have a four digit site identifier at the beginning so we leveraged this in order to do the file copy.

You can modify the script to accommodate your computer name scheme.