I am trying to copy files with powershell.
$datestamp = (Get-Date).ToString("yyyyMMdd")
Copy-Item -Path \\User\LS\ADMIN\HW\DATA\Payroll\$datestamp\*.txt -Destination C:\Users\User1\Desktop\New folder
The files that I am trying to copy are txt type and path for this and files are located two folders down from $datestamp. I've tried with this code and its not copying the files to path that I wanted. Is there any ways to fix this code to work?