SQL SERVER ISSUE on WINDOWS

when iam running below resource it’s executing fine. but not copying file from source to destination.

powershell_script “install_setup_MOVE_enterprise” do
code <<-EOH
Copy-Item \servername\Software\SQL_Server_2014\Enterprise-64bit-wSP2\SQL2014* -Destination C:/setup -recurse
EOH
guard_interpreter :powershell_script
end

I also tried in this way but it shows error to me i think iam making some mistake in term of path defining in windows, can someone please help with some short example how to achieve this.

z1 = "\servername\Software\SQL_Server_2014\Enterprise-64bit-wSP2\SQL2014"
des = "C:\setup"
powershell_script “install_setup_MOVE_enterprise” do
code <<-EOH
Copy-Item #{z1} * -Destination #{des} -recurse
EOH
guard_interpreter :powershell_script
end

let me know the exact error you are getting.

Could you verify if the UNC path starts with a double backslash?

Seems issue is with UNC path, why don’t you pass the full path of the source directory.
Use Get-Location command to check the current directory and accordingly you can change source path.

$z = (Get-Location .)
Write-Verbose -Message $z -Verbose