首页 > 解决方案 > Windows command prompt help in PowerShell

问题描述

This comes more or less from idle curiosity. I've been using DOS since the ear;y 80s, and before that CP/M-86. In the past several years, I've pretty much shifted to PowerShell. However, by habit of long standing, I still use the old DOS commands. In the Windows command prompt, I've been typing:

help dir
help dir > dirhelp.txt
help > doshelp.txt

Here's the question, and the answer most probably is, "No." Is there any PowerShell command (or cmd-let) that produces help for Windows commands?

Yeah, I know it's crazy, but inquiring minds want to know. 'gal' is the closest thing I use, but I miss the terse but useful DOS help.

标签: windowspowershellcmd

解决方案


PowerShell 有一个非常好的帮助系统,可以通过几种不同的方式使用,我倾向于使用以下方法的组合:

获取所有 PowerShell cmdlet:
Get-Command

在帮助下查找所有 cmdlet:
Get-Command "*help*

查找有关特定 cmdlet 的帮助:
Get-Help Get-ChildItem

查找带有别名的 cmdlet:
Get-Alias

您甚至可以执行以下操作:
Get-Help Dir -ExamplesGet-Help Dir -Online

希望这可以帮助!

不错的文章,供进一步阅读:
https ://www.darkoperator.com/blog/2013/1/15/powershell-basicsusing-the-help-subsystem.html


推荐阅读