PowerShell - File and Directory OperationsWhat does the PowerShell command Copy-Item do?ADuplicates files or folders to a new location without removing the originalBDeletes files or folders permanentlyCMoves files or folders to a new location and deletes the originalDRenames files or folders in the current locationCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand the purpose of Copy-ItemCopy-Item creates a copy of the specified file or folder at a new location, leaving the original intact.Step 2: Compare with other commandsUnlike Move-Item, Copy-Item does not remove the original file or folder.Final Answer:Duplicates files or folders to a new location without removing the original -> Option AQuick Check:Copy-Item = Duplicate without deleting original [OK]Quick Trick: Copy-Item duplicates; Move-Item moves and deletes original [OK]Common Mistakes:Confusing Copy-Item with Move-ItemThinking Copy-Item deletes the original fileAssuming Copy-Item renames files
Master "File and Directory Operations" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes File and Directory Operations - CSV operations (Import-Csv, Export-Csv) - Quiz 13medium File and Directory Operations - Remove-Item - Quiz 6medium Functions - Advanced functions (CmdletBinding) - Quiz 10easy Modules and Script Organization - PowerShell Gallery - Quiz 6medium Modules and Script Organization - Installing modules (Install-Module) - Quiz 11easy Regular Expressions - Why regex enables pattern matching - Quiz 7medium Regular Expressions - match operator - Quiz 10hard Working with Objects - Adding methods with ScriptMethod - Quiz 2easy Working with Objects - Measure-Object for statistics - Quiz 13medium Working with Objects - Object arrays - Quiz 7medium