The following script find all folders containing txt files
PS D:\Testfolder> Get-ChildItem -Recurse -Filter *.txt | Select-Object -ExpandProperty DirectoryName -Unique
D:\Testfolder\2nd
D:\Testfolder\3rd
D:\Testfolder\4th
D:\Testfolder\5th
D:\Testfolder\first
Now I want to move these folders to
D:\Testfolder\_dn
So that it looks the following -
D:\Testfolder\_dn\2nd
D:\Testfolder\_dn\3rd
D:\Testfolder\_dn\4th
D:\Testfolder\_dn\5th
D:\Testfolder\_dn\first
How can I do that?