Bird
0
0

You run this command but get an error:

medium📝 Debug Q14 of 15
PowerShell - File and Directory Operations
You run this command but get an error:
Move-Item -Path 'C:\Data\file.txt' -Destination 'C:\Archive\file.txt'

What is the most likely cause?
AThe destination path includes the filename, causing a conflict
BMove-Item cannot move files between drives
CMove-Item requires the -Force parameter to work
DThe source file does not exist or path is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Check if source file exists

    Move-Item fails if the source file path is wrong or file missing.
  2. Step 2: Understand destination path usage

    Destination can include filename; this is valid and not an error cause.
  3. Final Answer:

    The source file does not exist or path is incorrect -> Option D
  4. Quick Check:

    Missing source file causes Move-Item error [OK]
Quick Trick: Verify source file exists before moving [OK]
Common Mistakes:
  • Assuming destination filename causes error
  • Thinking Move-Item can't move across drives
  • Believing -Force is always required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes