{"id":13331,"date":"2011-07-13T00:01:00","date_gmt":"2011-07-13T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2011\/07\/13\/use-powershell-to-troubleshoot-software-installation\/"},"modified":"2011-07-13T00:01:00","modified_gmt":"2011-07-13T00:01:00","slug":"use-powershell-to-troubleshoot-software-installation","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-troubleshoot-software-installation\/","title":{"rendered":"Use PowerShell to Troubleshoot Software Installation"},"content":{"rendered":"<p><strong>Summary<\/strong>: Use Windows PowerShell to troubleshoot software installation.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hey, Scripting Guy! I am having a problem troubleshooting the installation of an MSI package. I am using Group Policy to deploy the MSI package, and on some computers, it seems to work, but on other computers it fails. After having read your most recent series of articles about troubleshooting Windows, I thought I could use a trace log, but after spending more than an hour trying to click all of those little folders (why is there no search on the log name?), I could not find a trace log that seemed to make sense. Anyway, I guess I am asking you how to troubleshoot remote installation of a MSI package. Hope you can help.<\/p>\n<p>&mdash;LT<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\" \/>Hello LT,<\/p>\n<p>Microsoft Scripting Guy Ed Wilson here. This morning, the Scripting Wife and I got to do something we have been looking forward to for nearly two months. When we were at Tech\u2219Ed 2011 in Atlanta, we got to meet a couple of scripters that work for a company that has a headquarters in the Charlotte area. We exchanged email, and this morning the Scripting Wife and I went to their office and made a three-hour &ldquo;Introduction to Windows PowerShell&rdquo; presentation. It was a lot of fun. One of the questions they had was related to troubleshooting remote systems.<\/p>\n<p>LT, you are not alone in your queries. In addition to the customer I was talking to this morning, there was also <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/07\/11\/use-dates-types-to-filter-event-trace-logs-in-powershell.aspx#comments\">a comment on Monday&rsquo;s blog post<\/a> from <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/05\/08\/lessons-learned-from-the-2011-scripting-games.aspx\">Klaus Schulte<\/a> (winner of the Beginner division of the 2011 Scripting Games) asking about troubleshooting installation packages.<\/p>\n<p>LT, there is a search for trace logs. It is called Windows PowerShell. I have given up attempting to navigate through the hundreds of logs in all the different folders (there are 492 logs on my Windows 7 Ultimate workstation). Instead, if I am searching for a log related to something, I use Windows PowerShell.<\/p>\n<p>In <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/07\/09\/use-powershell-to-troubleshoot-windows.aspx\">Saturday&rsquo;s Weekend Scripter article<\/a>, I talked about working with Event Tracing for Windows (ETW) logs. I discussed how to enable and disable the logs, and how to use the <b>Get-WinEvent<\/b> cmdlet to find and to read the trace. <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/07\/11\/use-dates-types-to-filter-event-trace-logs-in-powershell.aspx\">Monday, I continued the ETW discussion<\/a> by examining the <b>datetime<\/b> stamp that is generated for each event. <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/07\/12\/parse-windows-trace-logs-by-using-powershell.aspx\">Yesterday, I explored parsing the message property<\/a> of the WMI Activity Trace log.<\/p>\n<p>If I do not supply a value to the <i>listlog <\/i>parameter, an error appears. If I provide the name of a specific log, certain information about the log returns. If I use the <b>*<\/b> wildcard character, information about every log on the system is displayed in the Windows PowerShell console. If I use a more comprehensive wildcard character pattern, I can limit the number of logs that return. An example of searching for trace logs that relate to <b>install<\/b><i> <\/i>is shown here:<\/p>\n<p style=\"padding-left: 30px\">PS C:\\Windows\\system32&gt; Get-WinEvent -ListLog *install* -force | select logname<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">LogName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">&#8212;&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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staller\/Operational&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>I can use the same technique to search for logs that relate to <b>msi<\/b><i>.<\/i> In the following output, only one log relates to MSI, but it is associated with AppLocker. Therefore, it will not pick up any trace information from a generic MSI installation:<i><\/i><\/p>\n<p style=\"padding-left: 30px\">PS C:\\Windows\\system32&gt; Get-WinEvent -ListLog *msi* -force | select logname<\/p>\n<p style=\"padding-left: 30px\">&nbsp;<\/p>\n<p style=\"padding-left: 30px\">LogName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding-left: 30px\">Microsoft-Windows-AppLocker\/MSI and Script&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>At times, either I cannot find a trace log that I like, or I grow impatient from the search and then use one of my favorite tricks: query all the logs at once. Sure, it is inefficient, but if I am working locally, it is not a big deal. However, it can take a <i>very<\/i> long time for the command to complete (on my workstation, it takes nearly four minutes to complete the command). The thing to keep in mind is that after the first portion of time&mdash;it might be seconds or a minute or so depending on how much data you are returning and how recent your time filter is&mdash;new information will no longer be returned to the screen. This is the time when the command is continuing to process log files, but there is no longer any data to return even though the filter coming after the command to return all the event logs is still working. The (inefficient) command to return log files that have a timestamp that occurs later than &#8220;7\/11\/11 10:35:08 pm&#8221; follows this paragraph. To make the information display a bit better, I send the information to a table. In the following command the <b>Get-WinEvent<\/b> cmdlet returns all information from all log files. The returned entries are piped to the <b>Where-Object<\/b> cmdlet (<b>?<\/b> Is an alias for the <b>Where-Object<\/b> cmdlet), which filters log entries after a specific time. The results are piped to the <b>Format-Table<\/b> cmdlet (<b>ft<\/b> is an alias for <b>Format-Table<\/b> cmdlet), and three properties are selected. The command is shown here:<\/p>\n<p style=\"padding-left: 30px\">Get-WinEvent | ? {$_.TimeCreated -gt &#8220;7\/11\/11 10:35:08 pm&#8221; } | ft logname, id, message<\/p>\n<p>&nbsp;<\/p>\n<p>The following figure illustrates running the command in the Windows PowerShell ISE and displays the associated output.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0361.HSG-7-13-11-01.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of command running in Windows PowerShell ISE and associated output\" alt=\"Image of command running in Windows PowerShell ISE and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0361.HSG-7-13-11-01.png\" \/><\/a><\/p>\n<p>If I want to tighten up the output and create a more efficient use of the space in my output pane in the Windows PowerShell ISE, I can add the <i>autosize <\/i>parameter to the <b>Format-Table<\/b> cmdlet. In addition, I can display the entire message if I use the <i>wrap<\/i> parameter. However, when I add these parameters to the previous command, it will take the most of the time (five minutes or so) the command runs before displaying output. This is because to calculate the amount of space to allocate for the columns, Windows PowerShell needs to look at all of the data. This reduces the efficiency of the streaming behavior that I took advantage of earlier. The revised command is shown here:<\/p>\n<p style=\"padding-left: 30px\">Get-WinEvent | ? {$_.TimeCreated -gt &#8220;7\/11\/11 10:35:08 pm&#8221; } | ft logname, id, message -AutoSize &ndash;wrap<\/p>\n<p>Clearly, a more efficient method of working with log files is required.&nbsp;<\/p>\n<p style=\"padding-left: 30px\">For more information about using the <i>FilterHashTable<\/i> parameter, see <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/01\/24\/use-powershell-cmdlet-to-filter-event-log-for-easy-parsing.aspx\">Use a PowerShell Cmdlet to Filter Event Log for Easy Parsing<\/a> and <a href=\"http:\/\/blogs.technet.comhttps:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-parse-saved-event-logs-for-errors\/\">Use PowerShell to Parse Saved Event Logs for Errors<\/a>. For more information about improving the performance of event log queries, see <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/03\/08\/how-to-improve-the-performance-of-a-powershell-event-log-query.aspx\">How to Improve the Performance of a PowerShell Event Log Query<\/a>. For issues surrounding working remotely with Windows Vista and Windows XP event logs, refer to <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/03\/09\/discover-how-to-filter-remote-event-log-entries-in-windows-vista.aspx\">Discover How to Filter Remote Event Log Entries in Windows Vista<\/a>.&nbsp;<\/p>\n<p>The following table is copied from my <a href=\"http:\/\/blogs.technet.comhttps:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-parse-saved-event-logs-for-errors\/\">Use PowerShell to Parse Saved Event Logs for Errors<\/a> Hey, Scripting Guy! Blog post from January 2011.<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableHead\"><strong>Event Log Viewer name<\/strong><\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableHead\"><strong>FilterHashTable parameter key name<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Log Name<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">LogName<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Source<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">ProviderName<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Event ID<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">ID<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Level<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">Level<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">User<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">UserID<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Op Code<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">*<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Logged<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">*<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Task Category<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">*<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Keywords<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">*<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Computer<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">N\/A use &ndash;<i>ComputerName<\/i> parameter<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"312\">\n<p class=\"TableText\">Details<\/p>\n<\/td>\n<td valign=\"top\" width=\"306\">\n<p class=\"TableText\">Data<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>If I attempt to use my trick of using the <b>Get-Winevent<\/b> cmdlet to list all log entries, and I use a <b>FilterHashTable<\/b> to attempt to filter based on time at the <b>Get-Winevent<\/b> cmdlet instead of on the other side of the pipeline, an error returns that states I must specify either a log, provider, or path. The command and associated error appear here:<\/p>\n<p style=\"padding-left: 30px\">PS C:\\Windows\\system32&gt; Get-WinEvent -FilterHashTable @{StartTime = &#8220;7\/11\/11 10:35:08 pm&#8221;}<\/p>\n<p style=\"padding-left: 30px\">Get-WinEvent : You must specify at least one Log, Provider or Path key-value pair.<\/p>\n<p style=\"padding-left: 30px\">At line:1 char:13<\/p>\n<p style=\"padding-left: 30px\">+ Get-WinEvent &lt;&lt;&lt;&lt;&nbsp; -FilterHashTable @{StartTime = &#8220;7\/11\/11 10:35:08 pm&#8221;}<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; + CategoryInfo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : InvalidArgument: (:) [Get-WinEvent], Exception<\/p>\n<p style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; + FullyQualifiedErrorId : LogProviderOrPathNeeded,Microsoft.PowerShell.Commands.GetWinEventCommand<\/p>\n<p>&nbsp;<\/p>\n<p>I decide to modify the command to use a wildcard character for the <b>logname<\/b> key for the <b>FilterHashTable<\/b><i>.<\/i> The command works great and returns data nearly immediately:<\/p>\n<p style=\"padding-left: 30px\">Get-WinEvent -FilterHashtable @{StartTime = &#8220;7\/11\/11 10:35:08 pm&#8221;; LogName = &#8220;*&#8221;}<\/p>\n<p>&nbsp;<\/p>\n<p>The nice thing about the above command is it returns information from multiple logs and multiple providers. This is useful, for example, when troubleshooting installation problems that may be unrelated to the actual installer. To check a specific installation, it may be useful to filter based on not only the time, but also on the provider. For MSI installed software, the provider is the <b>msiInstaller<\/b> provider. The following command is broken at the pipe character for readability purposes. In reality it is a single command:<\/p>\n<p style=\"padding-left: 30px\">Get-WinEvent -FilterHashtable @{StartTime = &#8220;7\/11\/11 10:35:08 pm&#8221;; ProviderName = &#8220;msiInstaller&#8221;} |<\/p>\n<p style=\"padding-left: 30px\">ft logname, id, message -AutoSize &ndash;wrap<\/p>\n<p>The command and associated output appear in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6428.HSG-7-13-11-02.png\"><img decoding=\"async\" style=\"border: 0px\" title=\"Image of command and associated output\" alt=\"Image of command and associated output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6428.HSG-7-13-11-02.png\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>LT, that is all there is to using Windows PowerShell to look at Windows Installer logging. Troubleshooting Windows week will continue tomorrow.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><b>Ed Wilson, Microsoft Scripting Guy<\/b><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use Windows PowerShell to troubleshoot software installation. &nbsp; Hey, Scripting Guy! I am having a problem troubleshooting the installation of an MSI package. I am using Group Policy to deploy the MSI package, and on some computers, it seems to work, but on other computers it fails. After having read your most recent series [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[97,42,51,98,31,60,3,4,134,45],"class_list":["post-13331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-event-logs","tag-events-and-monitoring","tag-getting-started","tag-logs-and-monitoring","tag-operating-system","tag-performance","tag-scripting-guy","tag-scripting-techniques","tag-troubleshooting","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Use Windows PowerShell to troubleshoot software installation. &nbsp; Hey, Scripting Guy! I am having a problem troubleshooting the installation of an MSI package. I am using Group Policy to deploy the MSI package, and on some computers, it seems to work, but on other computers it fails. After having read your most recent series [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/13331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=13331"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/13331\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=13331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=13331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=13331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}