How do I do 'dir /s /b' in PowerShell?

后端 未结 7 567
梦毁少年i
梦毁少年i 2020-12-23 19:34

I have a folder with three files and want the equivalent of dir /s /b in PowerShell. How do I do that?

For example, if the folder name is temp3

相关标签:
7条回答
  • 2020-12-23 20:31

    If you are using Powershell as a shell (and not as a script processor), you can simply type:

    cmd /r dir /s /b
    

    The /r flag tells cmd.exe to run the command and exit. In other words, you'll end at the same execution context.

    For many commands, cmd /r is better than dealing with Powershell object-oriented architecture.

    0 讨论(0)
提交回复
热议问题