powershell - 如何在命令 Get-ItemProperty 中添加上次访问时间
问题描述
如何在此命令中添加 lastaccess 时间:
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table -AutoSize
解决方案
恐怕你不能。要查看您可以选择的所有属性,请运行以下命令:
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | gm
它将显示您可以从中获取信息的所有字段。
TypeName: System.Management.Automation.PSCustomObject
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
DisplayIcon NoteProperty string DisplayIcon=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Commo...
DisplayName NoteProperty string DisplayName=Visual Studio Enterprise 2019
DisplayVersion NoteProperty string DisplayVersion=16.2.29209.62
InstallDate NoteProperty string InstallDate=20190715
InstallLocation NoteProperty string InstallLocation=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
ModifyPath NoteProperty string ModifyPath="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installe...
PSChildName NoteProperty string PSChildName=18bd80bd
PSDrive NoteProperty PSDriveInfo PSDrive=HKLM
PSParentPath NoteProperty string PSParentPath=Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Wow...
PSPath NoteProperty string PSPath=Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Wow6432No...
PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\Registry
Publisher NoteProperty string Publisher=Microsoft Corporation
RepairPath NoteProperty string RepairPath="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installe...
UninstallString NoteProperty string UninstallString="C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_ins...
LastAccessTime 不是注册表项的属性。
也许您可以使用安装路径并在其中获取可执行文件的 ItemProperties 以确定最后一次使用该软件的时间。
推荐阅读
- java - 二分查找权应该是 nums.length 还是 nums.length - 1?
- ios - Compositional Layout UICollectionView iOS 14.4 无法滚动到最后一项
- python - 通过 add_job_flow_steps 将嵌套字典传递给 EMR
- reactjs - 为什么每当我输入不存在的内容时,都会出现此错误?
- python - 从 Python API 调用返回特定对象
- html - 使用 flex,如何在桌面和移动设备上以不同的方式订购内容?
- reactjs - React:在useEffect中使用自定义钩子时出现无限循环?
- android - 我的应用程序将在多长时间内发布到 Google Play 商店?
- android - 如何获得撰写组件的整个偏移量
- python - Manim:SurroundingRectangle 与 RoundedRectangle