简体   繁体   中英

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. 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.

这是我需要的价值的图片

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

Say you had a video file: 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. This will show you all of the IDs:

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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