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 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈