简体   繁体   English

Powershell:Get-Childitem,有没有办法列出评论?

[英]Powershell: Get-Childitem, is there a way to list comments?

I'm working with powershell but I'm kinda new to this So my problem is, I have a folder full of msi-packages. 我正在使用Powershell,但是对此有点陌生,所以我的问题是,我的文件夹里充满了msi-packages。 If I go properties -> Details, a description can be found in the comment section. 如果我转到属性->详细信息,则可以在评论部分找到描述。 Since I don't want to click everything, I would like to list them with powershell. 由于我不想单击所有内容,因此我想使用powershell列出它们。

这是我需要的价值的图片

So far I got this: 到目前为止,我得到了:

get-childitem c:\windows\installer\* -include *.msi

I can't find a solution and I'm grateful for any help. 我找不到解决方案,感谢您的帮助。

This isn't my solution; 这不是我的解决方案。 I am just pasting it here from this link 我只是通过此链接将其粘贴到此处

Here is some example code: 这是一些示例代码:

http://powershell.com/cs/blogs/tobias/archive/2011/01/07/organizing-videos-and-music.aspx http://powershell.com/cs/blogs/tobias/archive/2011/01/07/organizing-videos-and-music.aspx

Say you had a video file: C:\\video.wmv 假设您有一个视频文件:C:\\ video.wmv

$path = 'C:\video.wmv'
$shell = New-Object -COMObject Shell.Application
$folder = Split-Path $path
$file = Split-Path $path -Leaf
$shellfolder = $shell.Namespace($folder)
$shellfile = $shellfolder.ParseName($file)

You'll need to know what the ID of the extended attribute is. 您需要知道扩展属性的ID是什么。 This will show you all of the IDs: 这将显示所有ID:

0..287 | Foreach-Object { '{0} = {1}' -f $_, $shellfolder.GetDetailsOf($null, $_) }

Once you find the one you want you can access it like this: 找到所需的文件后,您可以按以下方式访问它:

$shellfolder.GetDetailsOf($shellfile, 216)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM