Command Line
PowerShell File and Folder Basics
List, create, copy, and move files with explicit PowerShell paths.
Follow the steps in order and stop if the screen or target does not match what is described. Use administrator access only when the task requires it.
Inspect the current path
Confirm where you are before changing files.
Command
Get-Location
Get-ChildItemCreate a folder
Use a quoted literal path.
Command
New-Item -ItemType Directory -Path "C:\Users\Public\ExampleFolder"Copy a file
Copy-Item leaves the source in place.
Command
Copy-Item -LiteralPath "C:\Users\Public\source.txt" -Destination "C:\Users\Public\ExampleFolder\source.txt"Move a file
Move-Item changes the source location. Verify both paths first.
Command
Move-Item -LiteralPath "C:\Users\Public\source.txt" -Destination "C:\Users\Public\ExampleFolder\source.txt"Treat deletion separately
Do not add Remove-Item to an untested script. List exact targets and maintain a backup first.