I have written a power-shell script that copy the files from one location to another locally on server. I am trying to assemble the files at one server location and while doing this getting permission error. Script below:-

```
$date = (Get-Date).ToString("_MMddyyyy")

#Storing servers

$Servers = Get-Content C:\server.txt

#Scanning Servers and executing 

$Servers | ForEach-Object {

invoke-command -ComputerName $_ -Scriptblock {
$CompName = (Get-WmiObject -Class Win32_ComputerSystem).Name

#Defining Source and Destination path

$DestPath =  "\\$CompName\d$\Temp\IIS_Logs_"+"$CompName"
$SourcePath = "\\$CompName\d$\Logs\W3SVC85\u_ex15122116.log"

#Creating new folder for storing backup

New-Item -Path $DestPath -ItemType directory

#Copying folder

copy -Recurse -Path $SourcePath -destination $DestPath 

}}

```