Windows PowerShell snap-in là một hội đồng. NET có chứa cmdlets, các nhà cung cấp, và như vậy. Windows PowerShell đi kèm với một bộ cơ bản snap-in cung cấp tất cả các lệnh cơ bản và các nhà cung cấp được xây dựng vào vỏ. Bạn viết một snap-in khi bạn muốn cmdlet hoặc nhà cung cấp dịch vụ của bạn | Chapter 3 Understanding the Extended Type System PS C C PS C C PS C Methods Methods are member types that can take arguments may return some value normally do significant work and cannot appear on the left-hand side of an expression. Specifically include Method ScriptMethod and CodeMethod member types. Methods are accessed from script using the same syntax as other members with the addition of parentheses at the end of the member name. All methods derive from PSMethodInfo which is summarized in Figure 3-14. class PSMethodInfo PSMemberInfo PSMethodInfo Invoke object object PSMethodInfo property OverloadDefinitions Collection string Value object Figure 3-14 Methods derived from PSMethodinfo Invoke is the basic mechanism used to call invoke the specified method. It is passed in the arguments with which to call the method as an array of objects. Note that these arguments are the value only no name. The order and type of the arguments must correspond to the expected parameters of the particular method being called. Type distance algorithms are used to match the arguments so that the correct overload is called see the section Distance Algorithm later in this chapter . Type conversion is used after type distance is determined to convert the arguments passed to invoke to the type of parameters needed by the method being called. Optional parameters and params parameters are considered in the distance algorithm and in the invocation of the method. 46 Chapter 3 Understanding the Extended Type System Value returns this instance of the derived method type this approach still enables us to derive from PSMemberInfo . Note that this is sealed and therefore the derived method types do not have to deal with this. Any attempt to set the value throws NotSupportedException. OverloadDefinitions is a collection of strings that state which overloads are available. These contain the complete signature for those .