Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.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列出.dll文件?_Powershell - Fatal编程技术网

正在使用powershell列出.dll文件?

正在使用powershell列出.dll文件?,powershell,Powershell,我正在编写一个脚本,以列出本例中具有特定扩展名(.dll)的所有文件。我的脚本工作正常,只是我想过滤掉所有拥有微软版权的文件。应该采取什么办法 $Dir = Get-ChildItem C:\Windows\Microsoft.NET\Framework -include *.dll -recurse | sort-object name | format-table name, directory -auto $Dir 在Where Object-语句中使用$\uux.VersionInfo

我正在编写一个脚本,以列出本例中具有特定扩展名(.dll)的所有文件。我的脚本工作正常,只是我想过滤掉所有拥有微软版权的文件。应该采取什么办法

$Dir = Get-ChildItem C:\Windows\Microsoft.NET\Framework -include *.dll -recurse | sort-object name | format-table name, directory -auto
$Dir

Where Object
-语句中使用
$\uux.VersionInfo.LegalCopyright
进行筛选。例:

$Dir = Get-ChildItem C:\Windows\Microsoft.NET\Framework -include *.dll -recurse |
Where-Object { $_.VersionInfo.LegalCopyright -notmatch 'Microsoft' }
$Dir | sort-object name | format-table name, directory -auto

切勿将
格式表
中的数据存储在变量中。它丢弃对象并返回不可用的格式对象。仅在输出到控制台时使用它,或在保存到文件时使用ex.
| Out String | Out File…

这对我很有效。有没有办法在表格的某一列中也打印出版者的名字?使用计算属性。你说的出版商是什么意思?使用
$dir[0].VersionInfo |格式列表*
查看可用属性。有一个叫做CompanyName的名字,如果你想知道的话。例如:
$Dir | sort object name | format table name,directory,@{n=“Publisher”;e={$\ VersionInfo.CompanyName}-auto
这是我想要的,谢谢。你能告诉我在哪里读到关于{n=;e=}的东西吗。它叫什么?谢谢你,弗罗德。这很有帮助。我从没听说过这件事。非常感谢,现在什么都没有。它现在运转良好。谢谢弗罗德。虽然我在另一个脚本上需要帮助,但我正在编写。:)将发布一个问题