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
Powershell 如何为当前模块设置LogPipelineExecutionDetails?_Powershell_Powershell 3.0 - Fatal编程技术网

Powershell 如何为当前模块设置LogPipelineExecutionDetails?

Powershell 如何为当前模块设置LogPipelineExecutionDetails?,powershell,powershell-3.0,Powershell,Powershell 3.0,我希望能够在模块的.psm1文件中设置LogPipelineExecutionDetails=$True(from),但当我使用模块名运行Get模块时,它不会返回任何内容。是否有其他方法获取当前模块的PSModuleInfo对象?尝试以下方法: get-module -list | Select Name, LogPipelineExecutionDetails 编辑: 要更改属性,似乎必须首先加载模块,即使在4.0中也是如此。加载模块似乎也是让get模块的-Name参数工作的一个要求 导入模

我希望能够在模块的.psm1文件中设置
LogPipelineExecutionDetails=$True
(from),但当我使用模块名运行Get模块时,它不会返回任何内容。是否有其他方法获取当前模块的PSModuleInfo对象?

尝试以下方法:

get-module -list | Select Name, LogPipelineExecutionDetails
编辑:

要更改属性,似乎必须首先加载模块,即使在4.0中也是如此。加载模块似乎也是让get模块的-Name参数工作的一个要求

导入模块AppLocker
(获取模块AppLocker).LogPipelineExecutionDetails=$True
获取模块AppLocker |选择名称、logpipelineexecutiondetails


这对我有用

它得到了结果,但当用于设置值时它不起作用。啊,好的,我想你只需要检索属性。我对它进行了更多的研究,见修改后的答案。谢谢,我得出了相同的结论。在我的模块的两个部分(引擎和UI)中有一个逻辑拆分,所以我将其拆分为两部分,并在UI模块的.psm1中执行此操作。