You can copy files in PowerShell using Copy-Item
, which lets you automate file transfers to local or remote directories. It’s especially useful when paired with PDQ Connect or PDQ Deploy to target multiple machines.
Let's dig into a few quick examples that show how to copy single files or entire folder structures.
In my examples, I’m copying into the %USERPROFILE%\AppData\Local folder of every user on a computer — but you can modify these scripts to copy any files to any location.
How do I copy a single file with PowerShell? (Get-ChildItem)
$Source = '\\FileShare\FancyConfigurationFiles\Config.xml'
$Destination = 'C:\users\*\AppData\Local\'
Get-ChildItem $Destination | ForEach-Object {Copy-Item -Path $Source -Destination $_ -Force}
How do I copy a folder recursively in PowerShell?
$Source = '\\FileShare\FancyConfigurationFiles\'
$Destination = 'C:\users\*\AppData\Local\'
Get-ChildItem $Destination | ForEach-Object {Copy-Item -Path $Source -Destination $_ -Force -Recurse}
How do I copy only the contents of a folder in PowerShell?
$Source = '\\FileShare\FancyConfigurationFiles\*'
$Destination = 'C:\users\*\AppData\Local\'
Get-ChildItem $Destination | ForEach-Object {Copy-Item -Path $Source -Destination $_ -Force -Recurse}
That’s it. It’s very simple and straightforward. The $Source is the file or folder that you wish to copy. The $Destination is the target folder that you wish to copy to.
Let’s take our script and combine it with PDQ Connect and then PDQ Deploy.
How do I run PowerShell scripts with PDQ Connect?
Need to copy files to remote machines over the internet? PDQ Connect runs PowerShell scripts on any online device with the agent installed — no VPN or network access required. It’s perfect for managing remote devices, satellite offices, or work-from-anywhere fleets.
Easily run PowerShell scripts on remote devices
Need to run your awesome PowerShell scripts on remote devices? PDQ Connect can easily execute PowerShell scripts on any managed device with an active internet connection.
1. Create a package
In the left navigation bar, click Packages. Then, click Create package in the upper right corner.

Name your package. Then, click the drop-down menu next to Add install step. Select Add script step.

Pop in the relevant script, and click Save.
2. Deploy the package
Your new package will now appear in the Packages tab. Check the box next to it, and click Deploy.

Then, select your target devices or groups and click Deploy.

That's all there is to it! With this method, you can deploy PowerShell scripts to on-prem and off-prem endpoints in one fell swoop.
How do I run PowerShell scripts with PDQ Deploy?
Copying files to your machines is easy with PDQ Deploy. While we recommend using the File Copy step for most jobs, PowerShell gives you next-level flexibility — like renaming files, generating content dynamically, or copying based on name, date, etc.
Install (and uninstall) without disruption
Try PDQ Deploy & Inventory — free for 14 days.
Prefer video? Look no further! But if you prefer written instructions, keep reading.
Loading...
Here’s a quick overview of how to deploy your new PowerShell script with PDQ Deploy.
1. Create a package
Creating a package using our new script is super easy. All that you need to do is create a package with an Install Step. Then, you just need to point the Install File to your script.
2. Deploy the package
We can now deploy our new package to any targets. The PowerShell script will run on the targets that you deploy to.
One thing to keep in mind when using PowerShell with PDQ Deploy: When an install step runs a PowerShell script, it only displays whether or not the script executed successfully. To see more detailed information, you’ll need to examine the output log of your deployment step.
While you’re waiting for your deployments, go get yourself a drink and pat yourself on the back. You just saved yourself a ton of manual effort. Way to go!
Using PowerShell gives you a lot of options for copying files. Give it a shot and have some fun! The sky is the limit for what you can do with a script.
Up for learning more PowerShell tips and tricks? Tune into The PowerShell Podcast. A new episode drops every Monday!