{"id":3891,"date":"2013-04-03T00:01:00","date_gmt":"2013-04-03T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2013\/04\/03\/excel-spreadsheets\/"},"modified":"2013-04-03T00:01:00","modified_gmt":"2013-04-03T00:01:00","slug":"excel-spreadsheets","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/excel-spreadsheets\/","title":{"rendered":"Excel Spreadsheets"},"content":{"rendered":"<p><strong style=\"font-size: 12px\">Summary<\/strong><span style=\"font-size: 12px\">: Microsoft MVP, Richard Siddaway, shares an excerpt from his book, <\/span><em style=\"font-size: 12px\">PowerShell in Practice.<\/em><\/p>\n<p><span style=\"font-size: 12px\">Microsoft Scripting Guy, Ed Wilson, is here. This week we will not have our usual <\/span><strong style=\"font-size: 12px\">PowerTip<\/strong><span style=\"font-size: 12px\">. Instead we have excerpts from seven books from Manning Press. In addition, each blog will have a special code for 50% off the book being excerpted that day. Remember that the code is valid only for the day the excerpt is posted. The coupon code is also valid for a second book from the Manning collection.<\/span><\/p>\n<p>Today, the excerpt is from <a href=\"http:\/\/www.manning.com\/siddaway\" target=\"_blank\">PowerShell in Practice<\/a><span style=\"text-decoration: underline\"><br \/> <\/span>&nbsp; By Richard Siddaway<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6131.hsg-4-3-13-1.png\"><img decoding=\"async\" style=\"border: 0px currentColor\" title=\"Photo of book cover\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6131.hsg-4-3-13-1.png\" alt=\"Photo of book cover\" \/><\/a><\/p>\n<p>It&rsquo;s a fair assumption to say that the Microsoft Office applications will be found on almost every desktop computer in work environments. It&rsquo;s possible to work with most of the Office applications by using Windows PowerShell. There are COM objects representing most of them. In this technique from <a href=\"http:\/\/www.manning.com\/siddaway\" target=\"_blank\">PowerShell in Practice<\/a>, author Richard Siddaway shows how to create an Excel spreadsheet and add data to it, and how to open a CSV file in Excel, from anywhere you are without triggering a pre-2007 bug.<\/p>\n<p class=\"Body1\" align=\"left\">In this set of tips, we&rsquo;ll concentrate on using Excel&nbsp;because this is one of the applications we&rsquo;re most likely to use as administrators. The Microsoft Script Center&nbsp;has a lot of VBScript script examples of using Excel that can be converted to Windows PowerShell. The first thing we need to do is to create an Excel spreadsheet, and spreadsheets&nbsp;seem much more useful when they have data in them.<\/p>\n<h2>Creating a spreadsheet<\/h2>\n<p class=\"Body1\" align=\"left\">Creating an Excel spreadsheet should be a simple act, in theory. But if you don&rsquo;t happen to be in the U.S., there&rsquo;s a slight issue in the shape of a bug in versions of Excel 2007&nbsp;and earlier that can prevent this from working. After reading this, it won&rsquo;t matter where you live. If you&rsquo;re using Excel 2010, the first version in Listing 1 can be used wherever you live and work.<\/p>\n<h3>Problem<\/h3>\n<p class=\"Body1\" align=\"left\">We need to create an Excel spreadsheet from within a Windows PowerShell script.<\/p>\n<h3>Solution<\/h3>\n<p>The Excel.application COM object can be used to create a spreadsheet.<\/p>\n<p><strong>Listing&nbsp;1: Create Excel spreadsheet<\/strong><\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl = New-Object -ComObject &#8220;Excel.Application&#8221;&nbsp;&nbsp;&nbsp; 1<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl.visible = $true<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xlbooks =$xl.workbooks.Add()<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl = New-Object -ComObject &#8220;Excel.Application&#8221;&nbsp;&nbsp;&nbsp; 2<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl.visible = $true<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xlbooks =$xl.workbooks<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$newci = [System.Globalization.CultureInfo]&#8221;en-US&#8221;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xlbooks.PSBase.GetType().InvokeMember(&#8220;Add&#8221;,<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">[Reflection.BindingFlags]::<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">InvokeMethod, $null, $xlbooks, $null, $newci)<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\"><strong>1 U.S. version<\/strong><\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\"><strong>2 International version<\/strong><\/p>\n<h3>Discussion<\/h3>\n<p class=\"Body1\" align=\"left\">If you live in the U.S. or are using a computer that&rsquo;s configured to the U.S. locale, you can use the first option in Listing 1. Otherwise, you have to use the second, international option. (See the Regional and Language settings in <strong>Control Panel<\/strong>, as shown in the following screenshot.)<\/p>\n<p class=\"Body1\" align=\"left\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8664.hsg-4-3-13-2.png\"><img decoding=\"async\" style=\"border: 0px currentColor\" title=\"Image of menu\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8664.hsg-4-3-13-2.png\" alt=\"Image of menu\" \/><\/a><\/p>\n<p class=\"Body1\" align=\"left\">If you want to remain with Windows PowerShell rather than succumbing to the GUI, you can check the culture by typing <strong>$psculture<\/strong> (in Windows PowerShell&nbsp;2.0). If en-US isn&rsquo;t returned, you need to use the second option in Listing 1.<\/p>\n<p class=\"Body\" align=\"left\">The simple way to create a spreadsheet starts by creating the COM object by using <strong>New-Object<\/strong>. We make it visible. Administrators are clever people, but working on an invisible spreadsheet may be a step too far&hellip;especially on a Monday morning. At this point, we have only the Excel application open. We need to add a workbook to enable us to use the spreadsheet.<\/p>\n<p class=\"Body\" align=\"left\">If the computer isn&rsquo;t using the U.S. culture (I live in England so <strong>$psculture<\/strong> returns en-GB), we have two options. The first option is to change the culture on the computer to en-US, which isn&rsquo;t convenient. Otherwise, we have to use the second option given in the listing.<\/p>\n<p class=\"Body\" align=\"left\">We start in the same way by creating the COM object and making the spreadsheet visible. A variable <strong>$xlbooks<\/strong>, which represents the workbooks in the spreadsheet is created. A second variable <strong>$newci<\/strong>, which represents the culture is created. Note that we&rsquo;re forcing the culture used to create the workbook to be U.S. English. The last line is a bit complicated, but we&rsquo;re dropping down into the base workbook object and invoking the <strong>Add<\/strong> method using the U.S. English culture. If you don&rsquo;t want to see the long list of data on screen when this last line is run, add <strong>| Out-Null<\/strong> to the end of the line. This is awkward, but it does get us past the bug. The good news is that, once we&rsquo;ve created our workbook, we can add data into it.<\/p>\n<h2>Adding data to a spreadsheet<\/h2>\n<p class=\"Body1\" align=\"left\">A spreadsheet without data isn&rsquo;t much use to us, so we need to investigate how we can add data into the spreadsheet and perform calculations on that data.<\/p>\n<h3>Problem<\/h3>\n<p class=\"Body1\" align=\"left\">We need to populate our spreadsheet with some data.<\/p>\n<h3>Solution<\/h3>\n<p class=\"Body1\" align=\"left\">Expanding on the previous script, we can create a worksheet to hold the data. The starting point is to remove any previous versions of spreadsheet #1, as shown in Listing 2. We use <strong>Test-Path<\/strong>&nbsp;to determine whether the file exists and <strong>Remove-Item<\/strong>&nbsp;to delete it. The <strong>Confirm<\/strong> parameter&nbsp;could be used with <strong>Remove-Item<\/strong> as an additional check if required. This is useful if working with important data.<span style=\"font-size: 12px\">&nbsp;<\/span><\/p>\n<p class=\"Body\"><strong>Listing&nbsp;2: Add data to Excel spreadsheet<\/strong><strong style=\"font-size: 12px\">&nbsp;<\/strong><\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$sfile = &#8220;C:\\test\\test.xlsx&#8221;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">if(Test-Path $sfile){Remove-Item $sfile}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl = New-Object -comobject &#8220;Excel.Application&#8221;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl.visible = $true<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xlbooks =$xl.workbooks<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$newci = [System.Globalization.CultureInfo]&#8221;en-US&#8221;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$wkbk = $xlbooks.PSBase.GetType().InvokeMember(&#8220;Add&#8221;,<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">[Reflection.BindingFlags]<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">::InvokeMethod, $null, $xlbooks, $null, $newci)<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$sheet = $wkbk.WorkSheets.Item(1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$sheet.Cells.Item(1,1).FormulaLocal = &#8220;Value&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$sheet.Cells.Item(1,2).FormulaLocal = &#8220;Square&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$sheet.Cells.Item(1,3).FormulaLocal = &#8220;Cube&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$sheet.Cells.Item(1,4).FormulaLocal = &#8220;Delta&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$row = 2&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; 4<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">for ($i=1;$i -lt 25; $i++){&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; 5<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; $f = $i*$i<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; $sheet.Cells.Item($row,1).FormulaLocal = $i<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; $sheet.Cells.Item($row,2).FormulaLocal = $f<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; $sheet.Cells.Item($row,3).FormulaLocal = $f*$i<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; $sheet.Cells.Item($row,4).FormulaR1C1Local = &#8220;=RC[-1]-RC[-2]&#8221;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;&nbsp;&nbsp; $row++<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">}<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;[void]$wkbk.PSBase.GetType().InvokeMember(&#8220;SaveAs&#8221;,<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">[Reflection.BindingFlags]<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">::InvokeMethod, $null, $wkbk, $sfile, $newci)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">&nbsp;<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">[void]$wkbk.PSBase.GetType().InvokeMember(&#8220;Close&#8221;,<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">[Reflection.BindingFlags]<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">::InvokeMethod, $null, $wkbk, 0, $newci)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl.Quit()&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; 8<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">1 Delete previous files<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">2 Create spreadsheet<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">3 Set headers<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">4 Row counter<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">5 Create data<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">6 Save<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">7 Close<\/p>\n<p class=\"CodeAnnotation\" style=\"padding-left: 30px\">8 Quit<\/p>\n<p class=\"Body1\" align=\"left\">The next step is to create the spreadsheet. In this case, I&rsquo;ve used the international method. After the workbook is created, we can create a worksheet (#2). Worksheet cells are referred to by the row and column, as shown by creating the column headers (#3).<\/p>\n<p class=\"Body\" align=\"left\">A <strong>counter<\/strong> is created (#4) for the rows. A <strong>for<\/strong> loop (#5) is used to calculate the square and the cube of the loop index. This is a simple example to illustrate the point. In reality, the data could be something like the number of rows exported compared to the number of rows imported for each table involved in a database migration. Note that the difference between the square and the cube is calculated by counting back from the current column.<\/p>\n<p class=\"Body\" align=\"left\">We save the spreadsheet when all of the data has been written to it (#6), and close the workbook (#7). Note that we have to use a similar construction to adding a workbook, in Excel 2007 and earlier, to get around the culture issue. If we were using the en-US culture, those lines would become:<\/p>\n<p class=\"Body\" style=\"padding-left: 30px\" align=\"left\"><span style=\"font-size: 12px\">$wkbk.SaveAs(&#8220;$file&#8221;)<\/span><\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$wkbk.Close()<\/p>\n<p class=\"Code\"><span style=\"font-size: 12px\">The last action is to quit the application (#8).<\/span><\/p>\n<h3>Discussion<\/h3>\n<p class=\"Body1\" align=\"left\">There are numerous reasons why you would want to record data into a spreadsheet but the performance implications must be understood.<\/p>\n<p class=\"Callout\" style=\"padding-left: 30px\" align=\"left\"><strong>Note<\/strong>&nbsp;&nbsp;&nbsp;Adding data into an Excel spreadsheet in this manner can be extremely slow. In fact, painfully slow if a lot of data needs to be written into the spreadsheet. I strongly recommend creating a CSV file with the data and manually importing it into Excel instead of working directly with the spreadsheet.<\/p>\n<p class=\"Body1\" align=\"left\">This technique could be used to create reports, for instance from some of the WMI-based scripts we saw earlier. The computer name and relevant information could be written into the spreadsheet. Alternatively, we can write the data to a CSV file and then open it in Excel.<\/p>\n<h2>Opening a CSV file in Excel<\/h2>\n<p class=\"Body1\" align=\"left\">We have seen how writing data directly into a spreadsheet is slow. Slow tends to get frustrating, so we need another way to get the data into a spreadsheet. If we can write the data to a CSV file, we can open that file in Excel. It&rsquo;s much faster and more satisfying.<\/p>\n<h3>Problem<\/h3>\n<p class=\"Body1\" align=\"left\">Having decided that we need to speed up creating our spreadsheet, we need to open a CSV file&nbsp;in Excel.<\/p>\n<h3>Solution<\/h3>\n<p class=\"Body1\" align=\"left\">The <strong>Open<\/strong> method&nbsp;will perform this action, as shown in Listing 3.<span style=\"font-size: 12px\">&nbsp;<\/span><\/p>\n<p class=\"Body1\" align=\"left\"><strong>Listing&nbsp;3: Open a CXV file<\/strong><\/p>\n<p class=\"Body\" style=\"padding-left: 30px\"><span style=\"font-size: 12px\">$xl = New-Object -comobject &#8220;excel.application&#8221;<\/span><\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl.WorkBooks.Open(&#8220;C:\\Scripts\\Office\\data.csv&#8221;)<\/p>\n<p class=\"Code\" style=\"padding-left: 30px\">$xl.visible = $true<\/p>\n<h3>Discussion<\/h3>\n<p class=\"Body1\" align=\"left\">As in the previous examples, we start by creating an object to represent the Excel application. We can then use the <strong>Open<\/strong> method of the workbooks&nbsp;to open the CSV file. The only parameter required is the path to the file. The full path has to be given. We then make the spreadsheet visible so we can work with it. Alternatively we could use:<\/p>\n<p class=\"Body\" style=\"padding-left: 30px\" align=\"left\"><span style=\"font-size: 12px\">Invoke-Item data.csv<\/span><\/p>\n<p class=\"Body1\" align=\"left\"><span style=\"font-size: 12px\">This depends on the default action in the file associations to open the file in Excel. Hal Rottenberg graciously reminded me of this one.<\/span><\/p>\n<p class=\"Body1\" align=\"left\"><span style=\"font-size: 12px\">The Microsoft Office applications are extremely widespread in the Windows environment. We can create and access documents using these applications in Windows PowerShell. This enables us to produce a reporting and documentation system for our computers based on using Windows PowerShell with WMI and COM.<\/span><\/p>\n<p class=\"Body1\" align=\"left\"><span style=\"font-size: 12px\">~Richard<\/span><\/p>\n<p style=\"padding-left: 30px\"><strong>Here is the code for the discount offer today at <\/strong><a href=\"http:\/\/www.manning.com\/\" target=\"_blank\">www.manning.com<\/a>: <strong>scriptw3<\/strong><br \/> Valid for 50% off <a href=\"http:\/\/www.manning.com\/siddaway\" target=\"_blank\">PowerShell in Practice<\/a> and <a href=\"http:\/\/www.manning.com\/jones\/LWPWSample-Ch-10.pdf\" target=\"_blank\">Learn Windows PowerShell in a Month of Lunches<\/a><br \/> Offer valid from April 3, 2013 12:01 AM until April 4 midnight (EST)<\/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\" target=\"_blank\">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><strong>Ed Wilson, Microsoft Scripting Guy<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Microsoft MVP, Richard Siddaway, shares an excerpt from his book, PowerShell in Practice. Microsoft Scripting Guy, Ed Wilson, is here. This week we will not have our usual PowerTip. Instead we have excerpts from seven books from Manning Press. In addition, each blog will have a special code for 50% off the book being [&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":[56,189,3,45],"class_list":["post-3891","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-guest-blogger","tag-richard-siddaway","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Microsoft MVP, Richard Siddaway, shares an excerpt from his book, PowerShell in Practice. Microsoft Scripting Guy, Ed Wilson, is here. This week we will not have our usual PowerTip. Instead we have excerpts from seven books from Manning Press. In addition, each blog will have a special code for 50% off the book being [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/3891","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=3891"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/3891\/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=3891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=3891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=3891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}