计数字符串输出的实例
我正在尝试计算服务器上特定dll的版本。找到我们拥有的版本相当容易,但是我想要每个版本的数量。这是我到目前为止的:
gci System.Web.Mvc.dll -Recurse -ErrorAction SilentlyContinue |
select-object -ExpandProperty VersionInfo |
Select FileVersion |
sort-object { [string]$_.FileVersion }
因此,如果上述输出:
1.2.3.4
1.2.3.4
1.2.3.4
5.6.7.8
9.0.1.2
9.0.1.2
我想要:我
1.2.3.4 3
9.0.1.2 2
5.6.7.8 1
想知道我该怎么做?
I'm trying to count versions of a specific DLL on our servers. Finding what version we have is fairly easy, but I want a rolled up count of each one. This is what I have so far:
gci System.Web.Mvc.dll -Recurse -ErrorAction SilentlyContinue |
select-object -ExpandProperty VersionInfo |
Select FileVersion |
sort-object { [string]$_.FileVersion }
So if the above output:
1.2.3.4
1.2.3.4
1.2.3.4
5.6.7.8
9.0.1.2
9.0.1.2
I'd want:
1.2.3.4 3
9.0.1.2 2
5.6.7.8 1
Any idea how I would do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是:
它在我的计算机上的随机目录上给出:
更改
< top级折线>
和incrude
以适合您的情况。One way to do it is:
Which, on a random directory on my machine, gives:
Change the
<top-level-folder>
and the-Include
to suit your situation.