Copy
Commands
Copy-Item src.txt dst.txt
Copy a file (cp, copy, cpi)
Copy-Item -Path file.txt -Destination file.txt
Copy
cp C:\source\file.txt C:\destination\file.txt
Alias for Copy-Item
copy C:\source\file.txt C:\destination\file.txt
Copy using CMD.
robocopy C:\source C:\destination file.txt /E
Recursive copy (/E).
type C:\path\to\file.txt | clip
Copies content to clipboard.
Copies files or directory trees to another location, with options for:
copying empty directories (/E)
assuming destination is a directory (/I)
including hidden and system files (/H)
Copies a file from one location to another using .NET framework in PowerShell, with $true indicating overwrite if the destination file exists.
Merges the content of two files into a third file.
Clipboard Ops
Get-Clipboard
Get clipboard contents
type C:\path\to\file.txt | clip
Copies file content to clipboard.
Get-Content C:\path\to\file.txt | Set-Clipboard
Copies file content to clipboard.
"Some text" | Set-Clipboard
Copies text to clipboard
Get-ChildItem C:\path\to\directory | Set-Clipboard
Copies file listing to clipboard.
Copy SAM and System Hive
Backup SAM and SYSTEM hashes:
Last updated
Was this helpful?