簡體   English   中英

我如何使用 Powershell 獲取 exe 應用程序詳細信息

[英]How Can I user Powershell to get exe app detail

我是 Powershell 的新手,正在嘗試獲取 outlook 文件版本詳細信息。

get-itemproperty 'C:\program File (x86)\Microsoft Office\office15\outlook.exe' | 格式列表

那是我使用的命令,但是會彈出 Cannot find path 錯誤。

outlook.exe 路徑:C:\program File (x86)\Microsoft Office\office15\outlook.exe

value 我需要File Version 和 Product Name value 是我想要的

outlook 的版本是 16 所以路徑不一樣......但是,下面應該為你動態找到安裝位置,所以它是無關緊要的。

#Set the Reg Key to find
$key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE\'

#Get the Reg Key Property
$outlookExePath = (Get-ItemProperty $key).'(default)'

#Use the Reg Key Property to get the FileInfo 
$OutlookExe = get-item $outlookExePath

#Output the File Info Properties as required    
$OutlookExe.VersionInfo.ProductVersion
$OutlookExe.VersionInfo.ProductName

#Or output selected properties together
$OutlookExe.VersionInfo|Select-Object -Property ProductName,ProductVersion

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM