Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在给定模块(从文件加载)中找到cmdlet_C#_Powershell_Cmdlet_Import Module - Fatal编程技术网

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

C# 如何在给定模块(从文件加载)中找到cmdlet,c#,powershell,cmdlet,import-module,C#,Powershell,Cmdlet,Import Module,我有一个充满PowerShell cmdlet的C#DLL,我想知道如何从PowerShell提示符检索cmdlet列表。我试过: Import-Module .\psconfig.dll Get-Command -Name psconfig 但这不起作用。(导入可以工作,但不是Get命令) 如何正确地执行此操作,以便仅获取DLL中包含的cmdlet列表?get命令-Name psconfig正在查找名为psconfig的cmdlet。要获取从psconfig.dll导入的cmdlet列表,您

我有一个充满PowerShell cmdlet的C#DLL,我想知道如何从PowerShell提示符检索cmdlet列表。我试过:

Import-Module .\psconfig.dll
Get-Command -Name psconfig
但这不起作用。(导入可以工作,但不是
Get命令


如何正确地执行此操作,以便仅获取DLL中包含的cmdlet列表?

get命令-Name psconfig
正在查找名为
psconfig
的cmdlet。要获取从
psconfig.dll
导入的cmdlet列表,您需要为该模块列出导入的cmdlet:

Get-Command -ListImported -Module psconfig
或者只是

Get-Command -Module psconfig

Get命令-Name psconfig
正在查找名为
psconfig
的cmdlet。要获取从
psconfig.dll
导入的cmdlet列表,您需要为该模块列出导入的cmdlet:

Get-Command -ListImported -Module psconfig
或者只是

Get-Command -Module psconfig

Get Command-Module some Module?Get Command-Module some Module?从未使用过“true”cmdlet--C#,而不是powershell。我猜dll模块不需要psd1?@JaquelineVanek脚本模块也不需要模块清单。拥有一个是很好的做法。从未使用过“true”cmdlet--C#,而不是powershell。我猜dll模块不需要psd1?@JaquelineVanek脚本模块也不需要模块清单。有一个是很好的做法。