Skip to content

Instantly share code, notes, and snippets.

@hughlilly
Last active September 6, 2021 22:12
Show Gist options
  • Save hughlilly/eb97d2dd3db12f476ec79bfba13cf7e4 to your computer and use it in GitHub Desktop.
Save hughlilly/eb97d2dd3db12f476ec79bfba13cf7e4 to your computer and use it in GitHub Desktop.
Powershell script using Get-Content to open text file containing filenames/partial paths and copy to current dir
# Prepends "J:\" to each line, copies to current directory -- specify with -Destination param, per
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/copy-item
# Add "-wi" (or ("--WhatIf") for a dry run
Get-Content .\list.txt | ForEach {Copy-Item J:\$_ -verbose}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment