Skip to content

Instantly share code, notes, and snippets.

@billkindle
Created May 3, 2018 19:40
Show Gist options
  • Save billkindle/f9b3fb7c4646307830ccff2d1cad8f13 to your computer and use it in GitHub Desktop.
Save billkindle/f9b3fb7c4646307830ccff2d1cad8f13 to your computer and use it in GitHub Desktop.
Simple way to copy a directory folder structure without copying contents of the folders.
<#
This script will only copy folder structure found in the $Source
path to the $Target path.
#>
# Adjust paths to suite needs
$Source = [path]
$Target = [path]
# This will only copy folders
Copy-Item -Path $Source -Destination $Target -Filter {PSIsContainer} -Recurse -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment