Copy Files to Share

#Gather files from computer and copy to network path with computername & date of transfer

$Date = Get-Date

$ShortDate = $Date.ToShortDateString()

$ShortTime = $Date.ToShortTimeString()

$computername = $env:COMPUTERNAME

#Filepath

$path = "C:\."

#Networkpath

New-Item -ItemType "directory" -Path "%path%\$computername"

Copy-Item -path $path -Destination "%path%\$computername" -Recurse

New-Item -Path "%path%\$computername\$ShortDate.txt"

#Registry value in case of use with SCCM

Set-ItemProperty -Path "HKLM:\%path%" -Name "GatherLogs" -Value 1