Path1: D:\TestFolder\1001\TestSubFolder1\TestSubFolder2\
Path2: D:\TestFolder
How to copy TestSubFolder2(with inside contents) of the path1 to path2?
Note: In path1 the folder 1001 is a dynamic name, it always gets change so can not use full directory.
"D:\TestFolder" is a fixed directory in path1
Below is the one example to copy files Copy-Item -Path "D:\TestFolder\1001\TestSubFolder1\TestSubFolder2\ *" -Destination "D:\TestFolder"
But the source directory is not fixed as 1001 folder name will be changed whenever build the code.