{"id":50913,"date":"2010-03-22T00:01:00","date_gmt":"2010-03-22T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/03\/22\/hey-scripting-guy-how-can-i-use-the-datagrid-control-in-windows-powershell\/"},"modified":"2010-03-22T00:01:00","modified_gmt":"2010-03-22T00:01:00","slug":"hey-scripting-guy-how-can-i-use-the-datagrid-control-in-windows-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-can-i-use-the-datagrid-control-in-windows-powershell\/","title":{"rendered":"Hey, Scripting Guy! How Can I Use the DataGrid Control in Windows PowerShell?"},"content":{"rendered":"<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><b><a class=\"addthis_button\" href=\"http:\/\/www.addthis.com\/bookmark.php?v=250&amp;pub=scriptingguys\"><img decoding=\"async\" alt=\"Bookmark and Share\" src=\"http:\/\/s7.addthis.com\/static\/btn\/v2\/lg-share-en.gif\" width=\"125\" height=\"16\"><\/a><br \/>&nbsp;<\/b><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><b>About the author:<\/b> Ravikanth works at Dell, Inc., as a lead engineer in the Microsoft SharePoint solutions team. He loves automation and is a Windows PowerShell fanatic. He writes regularly on <a title=\"his blog\" href=\"http:\/\/www.ravichaganti.com\/blog\">his blog<\/a> <\/font><\/font><font size=\"3\" face=\"Calibri\">about topics related to Windows PowerShell, SharePoint, and Microsoft server virtualization. He is also a moderator on the <\/font><a href=\"http:\/\/bit.ly\/scriptingforum\"><font size=\"3\" face=\"Calibri\">Hey, Scripting Guy! forum<\/font><\/a><font size=\"3\" face=\"Calibri\"> and a regular speaker at <\/font><a href=\"http:\/\/bitpro.in\/\"><font size=\"3\" face=\"Calibri\">Bangalore IT Pro<\/font><\/a><font size=\"3\"><font face=\"Calibri\"> user group meetings.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\" face=\"Calibri\">In an earlier blog post, Ed Wilson showed us how to <\/font><a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2010\/03\/01\/hey-scripting-guy-march-1-2010.aspx\"><font size=\"3\" face=\"Calibri\">create GUI using Windows PowerShell<\/font><\/a><font size=\"3\" face=\"Calibri\"> and SAPIEN PrimalForms. Using PrimalForms is a very powerful and easy way to create GUI for your Windows PowerShell scripts. You can export the code required to script a GUI to a Windows PowerShell script and then customize it to make it more useful. Behind the scenes, we use the <b>System.Windows.Forms<\/b> namespace to generate a GUI. There are <\/font><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.windows.forms.aspx\"><font size=\"3\" face=\"Calibri\">many GUI controls<\/font><\/a><font size=\"3\"><font face=\"Calibri\"> supported by this namespace. In today&rsquo;s post, we will see an example that shows how to use the&nbsp;<b>DataGrid<\/b> control to display the information in a tabular form.<span>&nbsp; <\/span><\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">First, we design a GUI form using SAPIEN&rsquo;s PrimalForms Community Edition. Let us call this Process Manager. The design is quite simple. We place a <b>DataGrid<\/b> control and three buttons, each with some custom text representing the action. When loaded, this form will list the running processes and let us stop a selected process or refresh the process information displayed in the grid. <\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><img decoding=\"async\" title=\"Image of Process Manager\" alt=\"Image of Process Manager\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/march\/hey0322\/processmanager.png\" width=\"600\" height=\"356\"><\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><br \/>After the design is complete, we export the form to a Windows PowerShell script using the &ldquo;Export PowerShell&rdquo; option. This generates the necessary code to create the GUI form in Windows PowerShell. Now, we need to edit this script to add the custom code we need to create our process manager.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">We need to perform the following script changes to make our process manager functional. <\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoListParagraphCxSpFirst\"><span><span><font size=\"3\" face=\"Calibri\">1.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font size=\"3\"><font face=\"Calibri\">Capture a list of processes and display all of that in the data grid when we open the form.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoListParagraphCxSpLast\"><span><span><font size=\"3\" face=\"Calibri\">2.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font size=\"3\"><font face=\"Calibri\">Enable all three buttons to function as expected.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">Before we go further into the details of this script, let us quickly look at how the <b>DataGrid<\/b> control is created. The following code shows the code generated by PrimalForms to add the <b>DataGrid<\/b> control to the main form:<\/p>\n<p><\/font><\/font><\/p>\n<table class=\"MsoTableGrid\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"624\">\n<p class=\"MsoNormal\"><span>$dataGrid1 = New-Object System.Windows.Forms.DataGrid<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$System_Drawing_Size = New-Object System.Drawing.Size<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$System_Drawing_Size.Width = 492<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$System_Drawing_Size.Height = 308<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$dataGrid1.Size = $System_Drawing_Size<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$dataGrid1.DataBindings.DefaultDataSourceUpdateMode = 0<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$dataGrid1.HeaderForeColor = [System.Drawing.Color]::FromArgb(255,0,0,0)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span lang=\"NO-BOK\">$dataGrid1.Name = &#8220;dataGrid1&#8221;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span lang=\"NO-BOK\">$dataGrid1.DataMember = &#8220;&#8221;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$dataGrid1.TabIndex = 0<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$System_Drawing_Point = New-Object System.Drawing.Point<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$System_Drawing_Point.X = 13<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$System_Drawing_Point.Y = 48<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$dataGrid1.Location = $System_Drawing_Point<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$form1.Controls.Add($dataGrid1)<\/p>\n<p><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">We use <b>System.Windows.Forms.DataGrid<\/b> namespace to create an instance as <b>$datagrid1<\/b>. After this instance is created, we assign values to properties such as size of the grid, name, and various other properties. We are not done yet. We need to assign a data source to display the process information in the grid. <\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">To display process information in the data grid at script startup, we need to add the necessary code to the form load event&mdash;<b>$form1.Add_Load()<\/b>. Because a <b>Refresh<\/b> button would also display process information in the grid, we will create a function so that we can reuse the code for both the form load and refresh button click events.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">The following code shows the function we created to display process information in the data grid:<\/p>\n<p><\/font><\/font><\/p>\n<table class=\"MsoTableGrid\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"624\">\n<p class=\"MsoNormal\"><span>function Get-ProcessInfo {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$array = New-Object System.Collections.ArrayList<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$Script:procInfo = Get-Process | Select Id,Name,Path,Description,VM,WS,CPU,Company | sort -Property Name<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$array.AddRange($procInfo)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$dataGrid1.DataSource = $array<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$form1.refresh()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>}<\/p>\n<p><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\" face=\"Calibri\">Within the <b>Get-ProcessInfo<\/b> function, we are creating an instance of the <b>System.Collections.ArrayList<\/b> object and the <b>$procInfo<\/b> object, and putting them in the <\/font><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dd315289.aspx\"><font size=\"3\" face=\"Calibri\">script scope<\/font><\/a><font size=\"3\"><font face=\"Calibri\"> so that they are available to other functions as required. After we retrieve the process information using the <b>Get-Process<\/b> cmdlet, we add <b>$procInfo<\/b> to <b>$array<\/b>, and assign <b>$array<\/b> as the data source to the <b>$dataGrid1<\/b> object. After the <b>DataSource<\/b> property is assigned, we make sure we display data in the grid by refreshing the form using <b>$form1.refresh()<\/b>.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">To make sure process information is displayed in the grid at script startup, we add the following code to <b>$OnLoadForm_UpdateGrid<\/b>:<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<table class=\"MsoTableGrid\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"624\">\n<p class=\"MsoNormal\"><span>$OnLoadForm_UpdateGrid=<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>{<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Get-ProcessInfo<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>}<\/p>\n<p><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">We then call it using the <b>$form1.add_load()<\/b> event:<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<table class=\"MsoTableGrid\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"624\">\n<p class=\"MsoNormal\"><span>#Add Form event<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$form1.add_Load($OnLoadForm_UpdateGrid)<\/p>\n<p><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">This will result in process information being displayed in the data grid, as shown here:<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><img decoding=\"async\" title=\"Image of process information displayed in the data grid\" alt=\"Image of process information displayed in the data grid\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/march\/hey0322\/processmanager1.png\" width=\"533\" height=\"453\"><\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">Now, let us move on to the second part of this process manager GUI. We need to enable &ldquo;refresh&rdquo;, &ldquo;Kill process&rdquo; and &ldquo;Close&rdquo; buttons on this form. The refresh button will refresh the process information displayed in the data grid, Kill process will terminate the selected process and close button will close the main form. For adding the code required to perform what is required, we use the button click events and assign code to Add_click() events of each button.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">Because we already have the code required to refresh the form as the <b>Get-ProcessInfo<\/b> function, we just call this function within the <b>$button1.Add_click()<\/b> event:<\/p>\n<p><\/font><\/font><\/p>\n<table class=\"MsoTableGrid\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"624\">\n<p class=\"MsoNormal\"><span>$button1_OnClick= <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>{<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Get-ProcessInfo<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>}<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>#Add the event<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$button1.add_Click($button1_OnClick)<\/p>\n<p><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">To stop a selected process, we add the following code to <b>$button2_OnClick<\/b> and add it to <b>$button2.Add_click()<\/b> event:<\/p>\n<p><\/font><\/font><\/p>\n<table class=\"MsoTableGrid\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"624\">\n<p class=\"MsoNormal\"><span>$button2_OnClick= <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>{<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>$selectedRow = $dataGrid1.CurrentRowIndex<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>if (($procid=$Script:procInfo[$selectedRow].Id)) {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stop-Process -Id $procid -Confirm<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>}<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>}<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>#add the event<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>$button2.add_Click($button2_OnClick)<\/p>\n<p><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">In the above code, we get the selected row&rsquo;s index into the <b>$selectedRow<\/b> variable and then use <b>$selectedRow<\/b> to retrieve the process ID of the selected process. You can select a process by either clicking the row header or anywhere within the row. When a row is selected, you can see a marker on the row header as shown in the following image. <\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><img decoding=\"async\" title=\"Image of row being selected\" alt=\"Image of row being selected\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/march\/hey0322\/selectedprocess.png\" width=\"493\" height=\"87\"><\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">After the process ID is captured in <b>$procid<\/b>, we use the <b>Stop-Process<\/b> cmdlet to terminate the process. We also use the <b>-Confirm<\/b> parameter with the <b>Stop-Process<\/b> cmdlet. <\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font size=\"3\" face=\"Calibri\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">So, when you run this script using the Windows PowerShell ISE and attempt to stop a process, you will see something similar to what is shown in the following image.<\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><img decoding=\"async\" title=\"Image of what is dispayed when you attempt to stop process\" alt=\"Image of what is dispayed when you attempt to stop process\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/march\/hey0322\/killnotepad.png\" width=\"600\" height=\"348\"><\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">Finally, we assign <b>$form1.Close()<\/b> to <b>$button3_OnClick<\/b>, and add it to <b>$button3.add_click()<\/b> event to enable the Close button. <\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\" face=\"Calibri\"><br \/>The complete code for this article is on the <\/font><a href=\"http:\/\/gallery.technet.microsoft.com\/ScriptCenter\/en-us\/3dcf0354-e7a7-482c-86f1-2e75809a502d\"><font size=\"3\" face=\"Calibri\">Script Center Script Repository<\/font><\/a><font size=\"3\"><font face=\"Calibri\">. <\/p>\n<p><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\" face=\"Calibri\">What we have seen so far is a basic implementation of data grid. We can automate the data grid refresh using the <\/font><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.windows.forms.timer.aspx\"><font size=\"3\" face=\"Calibri\">timer<\/font><\/a><font size=\"3\" face=\"Calibri\"> class. You can also a see a bit more advanced example of data grid control along with the <b>TreeView<\/b> control in the Windows PowerShell Remote File Explorer script at <\/font><a href=\"http:\/\/psremoteexplorer.codeplex.com\/\"><font size=\"3\" face=\"Calibri\">http:\/\/psremoteexplorer.codeplex.com\/<\/font><\/a><font size=\"3\"><font face=\"Calibri\">.<\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\"><\/p>\n<p><\/font><\/font>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; About the author: Ravikanth works at Dell, Inc., as a lead engineer in the Microsoft SharePoint solutions team. He loves automation and is a Windows PowerShell fanatic. He writes regularly on his blog about topics related to Windows PowerShell, SharePoint, and Microsoft server virtualization. He is also a moderator on the Hey, Scripting Guy! [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[81,71,56,82,3,45],"class_list":["post-50913","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-datagrid","tag-graphical","tag-guest-blogger","tag-ravikanth","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; About the author: Ravikanth works at Dell, Inc., as a lead engineer in the Microsoft SharePoint solutions team. He loves automation and is a Windows PowerShell fanatic. He writes regularly on his blog about topics related to Windows PowerShell, SharePoint, and Microsoft server virtualization. He is also a moderator on the Hey, Scripting Guy! [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/50913","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\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=50913"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/50913\/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=50913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=50913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=50913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}