Saya tidak berpikir Anda dapat melacak setiap file individu ke penginstal MSI. Namun, yang dapat Anda lakukan adalah melacak Lokasi Instal, jika dihuni oleh MSI dalam kunci registri ini
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\]
Ini adalah skrip yang dapat membantu Anda dengan itu.
#Get MOF File Method
$mof = @'
#PRAGMA AUTORECOVER
[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")]
class InstalledProducts {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallDate")] string InstallDate;
[read, propertycontext("InstallLocation")] string InstallLocation;
[read, propertycontext("InstallSource")] string InstallSource;
[read, propertycontext("Publisher")] string Publisher;
[read, propertycontext("EstimatedSize")] string EstimatedSize;
[read, propertycontext("UninstallString")] string UninstallString;
[read, propertycontext("WindowsInstaller")] string WindowsInstaller;
};
[dynamic, provider("RegProv"),
ProviderClsid("{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}"),ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432node\\Microsoft\\Windows\\CurrentVersion\\Uninstall")]
class InstalledProducts32 {
[key] string KeyName;
[read, propertycontext("DisplayName")] string DisplayName;
[read, propertycontext("DisplayVersion")] string DisplayVersion;
[read, propertycontext("InstallDate")] string InstallDate;
[read, propertycontext("InstallLocation")] string InstallLocation;
[read, propertycontext("InstallSource")] string InstallSource;
[read, propertycontext("Publisher")] string Publisher;
[read, propertycontext("EstimatedSize")] string EstimatedSize;
[read, propertycontext("UninstallString")] string UninstallString;
[read, propertycontext("WindowsInstaller")] string WindowsInstaller;
};
'@
$mof | Out-file -encoding ascii $env:TMP\InstalledProductsMof.txt -Force
mofcomp.exe $env:TMP\InstalledProductsMof.txt
Get-WmiObject -Namespace root\default -class InstalledProducts | Select DisplayName,DisplayVersion,InstallDate,InstallLocation, InstallSource,Publisher,EstimatedSize,UninstallString,WindowsInstaller
# CLEAN-UP: Remove the WMI Classes you just created
Remove-WmiObject -Namespace root\default -class InstalledProducts
Remove-WmiObject -Namespace root\default -class InstalledProducts32