Bird
0
0

Which of the following is the correct syntax to move a file named report.txt from C:\Docs to D:\Backup in PowerShell?

easy📝 Syntax Q12 of 15
PowerShell - File and Directory Operations
Which of the following is the correct syntax to move a file named report.txt from C:\Docs to D:\Backup in PowerShell?
ACopy-Item -Source 'C:\Docs\report.txt' -Target 'D:\Backup'
BMove-Item -Path 'C:\Docs\report.txt' -Destination 'D:\Backup'
CMove-Item -Source 'C:\Docs\report.txt' -Target 'D:\Backup' -Force
DCopy-Item -Path 'C:\Docs\report.txt' -Destination 'D:\Backup'
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct command for moving files

    Move-Item is used to move files; Copy-Item copies files.
  2. Step 2: Check the correct parameter names

    Move-Item uses -Path for source and -Destination for target location.
  3. Final Answer:

    Move-Item -Path 'C:\Docs\report.txt' -Destination 'D:\Backup' -> Option B
  4. Quick Check:

    Move-Item syntax = -Path and -Destination [OK]
Quick Trick: Use Move-Item with -Path and -Destination to move files [OK]
Common Mistakes:
  • Using Copy-Item instead of Move-Item to move files
  • Using incorrect parameter names like -Source or -Target
  • Omitting quotes around paths with backslashes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes