开发者

.NET class documentation from within PowerShell?

开发者 https://www.devze.com 2022-12-16 18:18 出处:网络
Is there a convenient method to access .NET class documentation (i.e. the MSDN documentation) from within PowerShel开发者_如何学编程 similar to \"man 3\" in UNIX shells?In the Powershell Community Ext

Is there a convenient method to access .NET class documentation (i.e. the MSDN documentation) from within PowerShel开发者_如何学编程 similar to "man 3" in UNIX shells?


In the Powershell Community Extensions 2.0 (still only available via daily builds), we extend Get-Help to add a -object parameter that, in conjunction with -online, will bring up MSDN documentation e.g.:

Get-Help -object (get-date) -online

Until we release a 2.0 beta (in a few weeks), grab the module file from here. Note that it requires features in PowerShell 2.0. Import this module like so:

Import-Module .\Pscx.GetHelp.psm1

Note that you can't use this on a namespace like System.Net but pick a type like System.Net.WebClient e.g.:

Get-Help -obj [System.Net.WebClient] -online

BTW, gives props to x0n (Oisin) for implementing this for PSCX.


This can be done by defining simple functions

function getDotNetHelp {
    param (
        $Object
    )
    Start-Process "https://learn.microsoft.com/en-us/dotnet/api/$($Object.getType().FullName)?view=powershellsdk-7.0.0"
}

Executing the following command will directly open the. Net help document

getDotNetHelp ""

The page is as follows

String Class (System) | Microsoft Docs

0

精彩评论

暂无评论...
验证码 换一张
取 消