简体   繁体   English

如何在给定模块中查找cmdlet(从文件加载)

[英]How do I find the cmdlets in a given module (loaded from file)

I have a C# DLL full of PowerShell cmdlets, and I want to know how to retrieve the list of cmdlets from a PowerShell prompt. 我有一个充满PowerShell cmdlet的C#DLL,我想知道如何从PowerShell提示符下检索cmdlet列表。 I've tried: 我试过了:

Import-Module .\psconfig.dll
Get-Command -Name psconfig

But that doesn't work. 但这是行不通的。 (the import works, but not the Get-Command ) (导入有效,但Get-Command无效)

What's the proper way to do this, so that I get a list of only the cmdlets included in my DLL? 什么是执行此操作的正确方法,以便仅获得DLL中包含的cmdlet的列表?

Get-Command -Name psconfig is looking for a cmdlet named psconfig . Get-Command -Name psconfig正在寻找一个名为psconfig的cmdlet。 To get a list of the cmdlets imported from psconfig.dll you need to list the imported cmdlets for that module: 要获取从psconfig.dll导入的cmdlet的列表,您需要列出该模块的导入的cmdlet:

Get-Command -ListImported -Module psconfig

or just 要不就

Get-Command -Module psconfig

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我在本地主机上创建 RunSpace 而不提供 runspaceconnectioninfo 时,某些 PowerShell 模块(集群 cmdlet)不会被加载 - Some of the PowerShell module (Cluster cmdlets) does not get loaded when I create RunSpace on a localhost without providing runspaceconnectioninfo 使用字符串生成器,我已经读取了一个文件..如何找到文件中是否存在给定的字符串? - Using a string builder, i've read a file.. How do i find if the given string is present in the file or not? 如何找到给定数据库的所有者? - How do I find the owner of a given database? 即使启用了假脱机文件池,如何找到具有给定ID的作业的假脱机文件? - How do I find the spool file for the job with a given ID even when spool file pooling is enabled? 如何读取内存中加载的模块的PE头? - How do I read the PE header of a module loaded in memory? 如何判断计算机中是否存在可以播放给定文件格式的播放器? - How do I find out if there is a player present in computer which can play a given file format? 使用LINQ,如何从List中找到具有给定属性值的对象? - Using LINQ, how do I find an object with a given property value from a List? 从aspx页面,如何访问动态加载的html文件的控件? - From an aspx page, how do I access a dynamically loaded html file's controls? 如何找到整数数组中有多少个给定数字? - How do I find how many of a given number there are in an array of ints? 如何从另一个文件中找到Git函数的调用? - How do I find calls to a function in Git from another file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM