Skip to main content
1 of 2
LPChip
  • 62.4k
  • 10
  • 101
  • 146

Command prompt is indeed different to PowerShell.

dir is an internal command of Command Prompt and Powershell does not have this function.

Powershell has the cmdlet: get-childitem, which also gets all files in a folder, but has significant differences compared to cmd's dir function.

To make people get started quickly in powershell, they added the alias dir, ls and gci to the cmdlet get-childitem. This means that, even though you can type in dir in powershell, none of the parameters work the way they work in cmd. For example, in cmd, you can type dir /s, in powershell, you would type get-childitem -recurse. Because dir is an alias for get-childitem, you can also type dir -recurse.

LPChip
  • 62.4k
  • 10
  • 101
  • 146