PowerShell 查找可用的控制台命令


在windows中有许多诸如IPconfig,whoami,SystemInfo的控制台命令。但是,这些命令默认都放在Windows文件中,并且被隐藏了起来。下面的函数可以帮我们找到这些命令,并且以本地化的描述信息返回在窗口中显示。

function Get-ConsoleCommand

{

$ext = $env:pathext -split ';' -replace '\.','*.'

$desc = @{N='Description'; E={$_.FileVersionInfo.FileDescription}}

Get-Command -Name $ext |

   Select-Object Name, Extension, $desc |

   Out-GridView

}

原文链接:http://powershell.com/cs/blogs/tips/archive/2012/10/18/discovering-useful-console-commands.aspx

本文链接: https://www.pstips.net/powershell-discovering-useful-console-commands.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

关于 Mooser Lee

我是一个Powershell的爱好者,创建了PowerShell中文博客,热衷于Powershell技术的搜集和分享。本站部分内容来源于互联网,不足之处敬请谅解,并欢迎您批评指正。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注