-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopying_User_Data.ps1
More file actions
22 lines (20 loc) · 977 Bytes
/
Copy pathCopying_User_Data.ps1
File metadata and controls
22 lines (20 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<#
.SYNOPSIS
This script is for copying data to a new PC
.NOTES
This script was written a very long time ago. If I am to do it again there would be error handling,arrays, and more data would be transferred.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
$NewPC,
[Parameter(Mandatory = $true)]
$OldPC,
[Parameter(Mandatory = $true)]
$Username
)
Copy-Item "\\$OldPC\C$\Users\$Username\Desktop" -Recurse -Destination "\\$NewPC\C$\Users\$Username\" -Verbose -Force
Copy-Item "\\$OldPC\C$\Users\$Username\Downloads" -Recurse -Destination "\\$NewPC\C$\Users\$Username\" -Verbose -Force
Copy-Item "\\$OldPC\C$\Users\$Username\Favorites" -Recurse -Destination "\\$NewPC\C$\Users\$Username\" -Verbose -Force
Copy-Item "\\$OldPC\C$\Users\$Username\Pictures" -Recurse -Destination "\\$NewPC\C$\Users\$Username\" -Verbose -Force
Copy-Item "\\$OldPC\C$\Users\$Username\Videos" -Recurse -Destination "\\$NewPC\C$\Users\$Username\" -Verbose -Force