{"id":13591,"date":"2011-06-18T00:01:00","date_gmt":"2011-06-18T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2011\/06\/18\/top-ten-favorite-powershell-tricks-part-1\/"},"modified":"2011-06-18T00:01:00","modified_gmt":"2011-06-18T00:01:00","slug":"top-ten-favorite-powershell-tricks-part-1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/top-ten-favorite-powershell-tricks-part-1\/","title":{"rendered":"Top Ten Favorite PowerShell Tricks: Part 1"},"content":{"rendered":"<h2><b>Create a Record of PowerShell Commands&nbsp;and Output, Find Hidden Objects, and Expand Properties<\/b><\/h2>\n<p><b>Summary<\/b>: Microsoft Scripting Guy, Ed Wilson, shares four of his top ten favorite Windows PowerShell tricks in this first of three blogs.<\/p>\n<h2><b>Weekend Scripter<\/b><\/h2>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. Without a doubt, I have the perfect job&mdash;at least for me. I get to play around with Windows PowerShell all day, and I get to do it every day. In addition, I get to talk to people from all over the world who are as excited about using Windows PowerShell as I am. Whenever two or more Windows PowerShell devotees get together, it is not very long before one of them drags out a laptop and begins to share something they have figured out using Windows PowerShell. It never fails. On Friday evening, following the last session of SQL Rally in Orlando, I sent a text message to the Scripting Wife to join me in the lobby of our hotel so we could go do dinner. The conversation went something like this:<\/p>\n<p>&ldquo;Hello, Scripting Wife. Would you like to meet me in the lobby so we can go get dinner?&rdquo; I asked.<\/p>\n<p>&ldquo;Where have&nbsp;you been?&rdquo; she asked.<\/p>\n<p>&ldquo;I went to Mark&rsquo;s session on data mining,&rdquo; I replied.<\/p>\n<p>&ldquo;Then what?&rdquo; she queried.<\/p>\n<p>&ldquo;Well, I was talking to Mark after the session,&rdquo; I said.<\/p>\n<p>&ldquo;Then what?&rdquo;<\/p>\n<p>&ldquo;Then nothing. I was talking to Mark.&rdquo;<\/p>\n<p>&ldquo;Oh. OK. Just wondering.&rdquo;<\/p>\n<p>&ldquo;I was answering a couple of questions he had about Windows PowerShell.&rdquo;<\/p>\n<p>&ldquo;I see. OK. I will see you in a few minutes.&rdquo;<\/p>\n<p>When I looked at my watch, I saw what had made her curious&mdash;it was 7:30 at night, and the session had been over for two hours. Woops! Mark had a question about environmental variables, and that led to me showing him one of my favorite Windows PowerShell tricks.<\/p>\n<p>NOTE: This is part 1 of a three part series of articles on my Top Ten Favorite PowerShell Tricks. I talk about<a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/06\/19\/top-ten-favorite-powershell-tricks-part-2.aspx\"> tricks 5 &#8211; 7 tommorow<\/a>, and <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/06\/20\/top-ten-favorite-powershell-tricks-part-3-working-with-ranges-dates-and-other-cool-powershell-tricks.aspx\">tricks 8-10 <\/a>the following day.<\/p>\n<h3>Trick #1: Use the transcript<\/h3>\n<p>When I am exploring Windows PowerShell, the first thing I do is create a transcript. The <b>Start-Transcript<\/b> cmdlet will create a transcript file that contains every command you type and the output associated with that command. The transcript is a text file that is stored in your user profile location. The file name is based on the current date and time that the transcript was created. To stop the transcript, use the <b>Stop-Transcript<\/b> cmdlet, or simply close the Windows PowerShell console.<\/p>\n<p>Why do I like the transcript? Well, if I am exploring, I am simply trying out different commands to see if I can find something useful. I do not know what I might find. By having a transcript, I have a complete record of everything I did. If I did find something useful, I have built in documentation for the commands. This facilitates training and learning. In addition, it is useful as a record of changes that I may have made to a system. The transcript shows the commands that are run and the results of those commands. A sample of transcript output is shown in the following image. Notice the header portion that gives user, computer, OS version, and time created information.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1325.HSG-6-18-11_4C4610BD.jpg\"><img decoding=\"async\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px\" title=\"Image of transcript\" border=\"0\" alt=\"Image of transcript\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0743.HSG-6-18-11_thumb_7DD17E52.jpg\" width=\"604\" height=\"376\" \/><\/a><\/p>\n<p>It might be interesting to compare the output from the transcript log file with the commands typed in the Windows PowerShell console. As shown in the following image, the command and output correspond directly.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0336.hsg-6-18-11-2_249F9493.jpg\"><img decoding=\"async\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px\" title=\"Image of command output\" border=\"0\" alt=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8863.hsg-6-18-11-2_thumb_444E6E5B.jpg\" width=\"604\" height=\"286\" \/><\/a><\/p>\n<h3>Trick #2: Look for &ldquo;hidden&rdquo; objects<\/h3>\n<p>What do I mean by &ldquo;hidden&rdquo; objects? Well, perhaps I could have called them &ldquo;embedded&rdquo; objects. Let me explain, many Windows PowerShell cmdlets return objects that contain other objects. Some of these objects are rather obvious; others are not. For example, on my laptop I use <b>Get-Process<\/b> to look for processes that begin with the letters wu and are followed by zero or more letters. The command and output are shown here.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt; Get-Process -Name wu*<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Handles<span>&nbsp; <\/span>NPM(K)<span>&nbsp;&nbsp;&nbsp; <\/span>PM(K)<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>WS(K) VM(M)<span>&nbsp;&nbsp; <\/span>CPU(s)<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Id ProcessName<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&#8212;&#8212;-<span>&nbsp; <\/span>&#8212;&#8212;<span>&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8211; &#8212;&#8211;<span>&nbsp;&nbsp; <\/span>&#8212;&#8212;<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212; &#8212;&#8212;&#8212;&#8211;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><span>213<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>11<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1852<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>6236<span>&nbsp;&nbsp;&nbsp; <\/span>60<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1268 WUDFHost<\/span><\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><span>211<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>9<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1824<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>5640<span>&nbsp;&nbsp;&nbsp; <\/span>37<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1360 WUDFHost<\/span><\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt;<\/span><\/span><\/span><span><\/span><\/p>\n<\/blockquote>\n<p>To hone in on one of those processes, I use the process ID and pipe the results to the <b>Format-List<\/b> cmdlet. This command and output are shown here.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt; Get-Process -id 1360 | fl * -Force<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">__NounName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Process<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: WUDFHost<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Handles<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 211<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">VM<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 39145472<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">WS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 5775360<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PM<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1867776<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">NPM<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 9496<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Path<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Company<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">CPU<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">FileVersion<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ProductVersion<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Description<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Product<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Id<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1360<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PriorityClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">HandleCount<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 211<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">WorkingSet<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 5775360<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PagedMemorySize<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1867776<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PrivateMemorySize<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1867776<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">VirtualMemorySize<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 39145472<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">TotalProcessorTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">BasePriority<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 8<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ExitCode<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">HasExited<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ExitTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Handle<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">MachineName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: .<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">MainWindowHandle<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 0<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">MainWindowTitle<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">MainModule<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">MaxWorkingSet<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">MinWorkingSet<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Modules<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">NonpagedSystemMemorySize<span>&nbsp;&nbsp; <\/span>: 9496<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">NonpagedSystemMemorySize64 : 9496<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PagedMemorySize64<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1867776<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PagedSystemMemorySize<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 70936<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PagedSystemMemorySize64<span>&nbsp;&nbsp;&nbsp; <\/span>: 70936<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PeakPagedMemorySize<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1961984<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PeakPagedMemorySize64<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1961984<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PeakWorkingSet<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 5812224<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PeakWorkingSet64<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 5812224<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PeakVirtualMemorySize<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 40194048<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PeakVirtualMemorySize64<span>&nbsp;&nbsp;&nbsp; <\/span>: 40194048<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PriorityBoostEnabled<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PrivateMemorySize64<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 1867776<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PrivilegedProcessorTime<span>&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ProcessName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: WUDFHost<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ProcessorAffinity<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Responding<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: True<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">SessionId<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 0<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StartInfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: System.Diagnostics.ProcessStartInfo<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StartTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">SynchronizingObject<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Threads<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: {1364, 1368, 1372, 1376&#8230;}<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">UserProcessorTime<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">VirtualMemorySize64<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp; <\/span>: 39145472<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">EnableRaisingEvents<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StandardInput<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StandardOutput<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StandardError<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">WorkingSet64<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 5775360<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Site<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Container<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p><span style=\"line-height: normal;list-style-type: disc\"><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt;<\/span><\/span><\/span><\/p><\/blockquote>\n<p>In the previous output, the <b>StartInfo<\/b> property returns an object. The object is an instance of the <b>ProcessStartInfo<\/b> object. The applicable line from the output is shown here.<\/p>\n<blockquote>\n<p><span style=\"line-height: normal;list-style-type: disc\"><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StartInfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: System.Diagnostics.ProcessStartInfo<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>To access this object, all one needs to do is to use &ldquo;dotted notation,&rdquo; which means I put parentheses around the command, and directly access the property. When I do this, the <b>ProcessStartInfo<\/b> object will be revealed. I illustrate this technique here.<\/p>\n<blockquote>\n<p>PS C:\\&gt; (Get-Process -id 1360).StartInfo<\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt; (Get-Process -id 1360).StartInfo<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Verb<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Arguments<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">CreateNoWindow<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">EnvironmentVariables<span>&nbsp;&nbsp;&nbsp; <\/span>: {temp, processor_revision, processor_level, logonserver&#8230;}<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">RedirectStandardInput<span>&nbsp;&nbsp; <\/span>: False<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">RedirectStandardOutput<span>&nbsp; <\/span>: False<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">RedirectStandardError<span>&nbsp;&nbsp; <\/span>: False<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StandardErrorEncoding<span>&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">StandardOutputEncoding<span>&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">UseShellExecute<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: True<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Verbs<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: {}<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">UserName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Password<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">Domain<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">LoadUserProfile<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">FileName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">WorkingDirectory<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ErrorDialog<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">ErrorDialogParentHandle : 0<\/span><\/span><\/span><\/p>\n<p><span style=\"line-height: normal;list-style-type: disc\"><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">WindowStyle<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Normal<\/span><\/span><\/span><\/p><\/blockquote>\n<h3>Trick #3: Use Select <i>ExpandProperty<\/i><\/h3>\n<p>When examining objects in Windows PowerShell, some embedded objects are obvious&mdash;like the one in Trick #2 that I just discussed. Other objects are not so obvious. In the previous example, the <b>StartInfo<\/b> property returns a <b>ProcessStartInfo<\/b> object. In the output that follows, the <b>EnvironmentVariables <\/b>property appears truncated.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">EnvironmentVariables<span>&nbsp;&nbsp;&nbsp; <\/span>: {temp, processor_revision, processor_level, logonserver&#8230;} <\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>This information appears to be impossible to retrieve. A few common attempts for seeing all of the <b>EnvironmentVariables <\/b>information are shown here.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt; (Get-Process -id 1360).StartInfo | fl environmentVariables<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">EnvironmentVariables : {temp, processor_revision, processor_level, logonserver&#8230;}<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt; (Get-Process -id 1360).StartInfo | ft environmentVariables<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">EnvironmentVariables<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">{temp, processor_revision, processor_level, logonserver&#8230;}<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt; (Get-Process -id 1360).StartInfo | ft environmentVariables -Force<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">EnvironmentVariables<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">{temp, processor_revision, processor_level, logonserver&#8230;}<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">&nbsp;<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt;<\/span><\/span><\/span><span><\/span><\/p>\n<\/blockquote>\n<p>Unfortunately, it seems that nothing can return all of this information&mdash;that is until I use the <b>Select-Object<\/b> cmdlet with the <i>ExpandProperty<\/i> parameter. In the example that follows, I use the <b>Select<\/b> alias for the <b>Select-Object<\/b> cmdlet. This results in the command that is shown here.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">(Get-Process -id 1360).StartInfo | select -ExpandProperty environmentvariables<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>As shown in the figure that follows, this command opens an entire page of additional information.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/8688.hsg-6-18-11-3_1D142526.jpg\"><img decoding=\"async\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border: 0px\" title=\"Image of command output\" border=\"0\" alt=\"Image of command output\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/6116.hsg-6-18-11-3_thumb_1CA7F231.jpg\" width=\"604\" height=\"396\" \/><\/a><\/p>\n<h3>Trick #4 Group and dot<\/h3>\n<p>Earlier, I needed to hone in on the <b>StartInfo<\/b> property of my process. I could have stored the process object in a variable, and then used a dotted notation to reference the <b>StartInfo<\/b><i> <\/i>property. This technique is shown here.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">$a = Get-Process -id 1360<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">$a.StartInfo<\/span><\/span><\/span><span><\/span><\/p>\n<\/blockquote>\n<p>But often that technique is not required. If a property returns a single item, I can use a pair of parentheses to group my command, and then use the dotted notation to return my desired property directly. The parentheses tell Windows PowerShell to process the command inside the parentheses first, then return the object, and then return the information from my property. This is illustrated here.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">(Get-Process -id 1360).Startinfo<\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>If I want to, I can continue to add additional dots. Because the <b>StartInfo<\/b> property returns an object, there are additional members exposed via the returned object. If the property is a single item, I can add additional dots to return the additional properties. In general, I do not use this technique because I think it begins to get confusing. However, when exploring in an interactive fashion inside the Windows PowerShell console, I will play around with double-dotted notation, and at times even with triple-dotted notation. The following is an example of using this technique to explore a specific property from the <b>StartInfo <\/b>object of a process object.<\/p>\n<blockquote>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span style=\"color: #000000\">PS C:\\&gt; (Get-Process -id 1360).Startinfo.loaduserprofile<\/span><\/span><\/span><\/p>\n<p style=\"line-height: 13.25pt;list-style-type: disc;margin: 0in 0in 8pt\" class=\"MsoNormal\"><span style=\"color: #000000\"><span><span style=\"font-family: Lucida Sans Typewriter\"><span>False<\/span><\/span><\/span><span><span style=\"font-family: Segoe\"><span> <\/span><\/span><\/span><\/span><\/p>\n<\/blockquote>\n<p>Join me tomorrow for <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2011\/06\/19\/top-ten-favorite-powershell-tricks-part-2.aspx\">part 2 of my Top Ten Favorite PowerShell Tricks.<\/a><\/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\">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","protected":false},"excerpt":{"rendered":"<p>Create a Record of PowerShell Commands&nbsp;and Output, Find Hidden Objects, and Expand Properties Summary: Microsoft Scripting Guy, Ed Wilson, shares four of his top ten favorite Windows PowerShell tricks in this first of three blogs. Weekend Scripter Microsoft Scripting Guy, Ed Wilson, is here. Without a doubt, I have the perfect job&mdash;at least for me. [&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":[51,3,4,45],"class_list":["post-13591","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-getting-started","tag-scripting-guy","tag-scripting-techniques","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Create a Record of PowerShell Commands&nbsp;and Output, Find Hidden Objects, and Expand Properties Summary: Microsoft Scripting Guy, Ed Wilson, shares four of his top ten favorite Windows PowerShell tricks in this first of three blogs. Weekend Scripter Microsoft Scripting Guy, Ed Wilson, is here. Without a doubt, I have the perfect job&mdash;at least for me. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/13591","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=13591"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/13591\/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=13591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=13591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=13591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}