Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
InfrastructureJuniorOccasionalTheory

What is the practical difference between Windows Command Prompt and PowerShell?

Answer

Command Prompt mainly runs traditional console programs and batch commands and passes text between commands. PowerShell is an automation shell and scripting language built around cmdlets and structured .NET objects, so filtering, selecting properties, error handling and automation are usually more reliable than parsing formatted text.

Strong answer includes

  • CMD is primarily text-oriented and batch-compatible
  • PowerShell pipelines pass structured objects between cmdlets
  • chooses the shell based on task and available tooling

Practical example

To find a Windows process, `tasklist | findstr java` parses text, while `Get-Process java | Select-Object Name,Id,CPU` works with process objects and explicit properties.

#windows#powershell#cmd#command-line

Sources

Windows commands referenceMicrosoft · Command Prompt utilities including ipconfig, netstat, tasklist, taskkill, sc, findstr, ping, tracert and nslookupPowerShell documentationMicrosoft · PowerShell cmdlets, object pipeline, processes, services, networking, event logs and environment handlingPowerShell Interview QuestionsWeCP · Recurrence signal for PowerShell fundamentals, cmdlets, services, processes, pipelines and troubleshooting questions