Modules and Snap-ins
Cmdlets can be added to a session using modules (introduced by Windows PowerShell 2.0) or snap-ins. Once the cmdlet is added to the session it can be run programmatically by a host application or interactively at the command line.
We recommend that you use modules as the delivery method for adding cmdlets to a session for the following reasons:
Modules allow you to add cmdlets by loading the assembly where the cmdlet is defined. There is no need to implement a snap-in class.
Modules allow you to add other resources, such as variables, functions, scripts, types and formatting files, and more.
Snap-ins can be used only to add cmdlets and providers to the session.
See Also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應