What is PowerShell and how does it differ from Command Prompt?

Beginner

Answer

PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and scripting language built on .NET Framework.

Key differences from Command Prompt:

PowerShell:

  • Object-oriented (works with .NET objects)
  • Extensive cmdlet library with consistent syntax
  • Advanced scripting capabilities
  • Built-in help system and tab completion
  • Can access .NET Framework and WMI
  • Supports aliases for common commands

Command Prompt:

  • Text-based input/output
  • Limited built-in commands
  • Basic scripting with batch files
  • Legacy tool dating back to DOS

Example: In PowerShell, Get-Process returns process objects with properties and methods. In CMD, tasklist returns text output that requires parsing.