我创建了一个简单的PowerShell代码,可以将文件夹从一台计算机复制到另一台计算机,但我一直在找到一个未找到的网络路径"有什么我做错了吗?
# PowerShell Read-Host Input Box
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
Clear-Host
$ComputerName1 = Read-Host "What is the name of your computer?"
$ComputerName2 = Read-Host "What is the name of the computer you are fixing?"
$Yours = $ComputerName1
$Theirs = $ComputerName2
robocopy "\\$ComputerName1\c:\Temp\Test" "\\$ComputerName2\c:\Temp\"