RepoTemplate/applyto.ps1
2024-10-29 07:39:52 -06:00

18 lines
607 B
PowerShell

$targetDirectory = $args[0]
# This is broken! Returns "c:\users\<$targetDirectory>"!
# $targetDirectory = [System.IO.Path]::GetFullPath($targetDirectory)
if (!(test-path("$targetDirectory")))
{
throw "Target directory $targetDirectory does not exist."
}
copy * $targetDirectory -Recurse -exclude @("applyto.ps1")
echo "Be sure to move projects and files to the source directory if they aren't already, and remove any unwanted placeholder files inside the new folders."
echo ""
echo "Want to explore the folder now? Press any key to explore or CTRL-C to finish."
pause
start Explorer $targetDirectory