.NET class documentation from within PowerShell?
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
精彩评论