{"id":50973,"date":"2010-03-16T00:01:00","date_gmt":"2010-03-16T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/03\/16\/hey-scripting-guy-how-can-i-manage-windows-powershell-jobs\/"},"modified":"2010-03-16T00:01:00","modified_gmt":"2010-03-16T00:01:00","slug":"hey-scripting-guy-how-can-i-manage-windows-powershell-jobs","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-can-i-manage-windows-powershell-jobs\/","title":{"rendered":"Hey, Scripting Guy! How Can I Manage Windows PowerShell Jobs?"},"content":{"rendered":"<p class=\"MsoNormal\"><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>&nbsp;<\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\"><\/p>\n<p class=\"MsoNormal\">Hey, Scripting Guy! I am not sure how much help running the <b>Get-Process<\/b> cmdlet as a job is going to be for me in my work environment. I kind of get what you are trying to do<span>&mdash;<\/span>provide an illustrative technique for working with Windows PowerShell jobs<span>&mdash;<\/span>but I have things that take a really long time. I need to know not only how to run that process as a job, but also how to kill that process if it is eating too many resources. Is there a way to manage Windows PowerShell jobs after they have been created?<\/p>\n<p class=\"MsoNormal\">&#8212; BP<\/p>\n<p class=\"MsoNormal\">\n<p>&nbsp;<\/p>\n<\/p>\n<p class=\"MsoNormal\"><img decoding=\"async\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\">Hello BP, <\/p>\n<p class=\"MsoNormal\">Microsoft Scripting Guy Ed Wilson here. I am listening to Miles Davis on my Zune HD, while mulling over the e-mail sent to <a href=\"http:\/\/blogs.technet.commailto:scripter@microsoft.com\"><font face=\"Segoe\">scripter@microsoft.com<\/font><\/a>. I made a pot of Krauter Tea using some tea I brought back from Germany. Krauter tea goes really well with <a href=\"http:\/\/en.wikipedia.org\/wiki\/Leibniz-Keks\"><font face=\"Segoe\">choco Leibniz biscuits<\/font><\/a>, a German made biscuit. I was in Berlin teaching a WMI class, and really enjoyed walking around <a href=\"http:\/\/en.wikipedia.org\/wiki\/Potsdamer_Platz\"><font face=\"Segoe\">Potsdamer Platz<\/font><\/a> and drinking tea in some of the outdoor cafes. There is a really cool train system there that allows you to roam all over the city. The following photograph is one I took on one of these walks during a particularly clear night. The interplay of ambient light and softly curved mass make this picture one of my favorite photographs from that trip, with the possible exception of some from the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Brandenburg_Gate\"><font face=\"Segoe\">Brandenburg Gate<\/font><\/a> that I will show you in a later article. Berlin is a great town for taking pictures.<\/p>\n<p class=\"MsoNormal\"><img decoding=\"async\" title=\"Photograph Ed took in Berlin, Germany\" alt=\"Photograph Ed took in Berlin, Germany\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/march\/hey0316\/hsg-03-16-10-01.jpg\" width=\"600\" height=\"800\"><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/march\/hey0316\/hsg-03-16-10-01.jpg\"><\/a><\/p>\n<p class=\"Fig-Graphic\">\n<p>&nbsp;<\/p>\n<\/p>\n<p class=\"MsoNormal\">BP, before we look at managing Windows PowerShell jobs, I want to spend a bit more time talking about running Windows PowerShell jobs, expounding on <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/archive\/2010\/03\/15\/hey-scripting-guy-march-15-2010.aspx\"><span>our discussion from yesterday<\/span><\/a>. <\/p>\n<p class=\"MsoNormal\">When starting a Windows PowerShell job via the Start-Job cmdlet, you can assign a name to hold the returned job object. You can also assign the returned job object in a variable by using a straight forward value assignment. If you do both, you end up with two copies of the returned job object. This is shown here. <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; $rtn = Start-Job -Name getSoftware -ScriptBlock {gwmi win32_software}<br \/>PS C:&gt; Get-Job -Name get*<\/p>\n<p>Id<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>State<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>HasMoreData<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Location<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Command<br \/>&#8212;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;-<br \/>1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>getSoftware<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Completed<span>&nbsp; <\/span>True<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>localhost<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>gwmi win32_software<\/p>\n<p>PS C:&gt; $rtn<\/p>\n<p>Id<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>State<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>HasMoreData<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Location<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Command<br \/>&#8212;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;<\/span>&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;-<br \/>1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>getSoftware<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Completed<span>&nbsp; <\/span>True<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>localhost<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>gwmi win32_software<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">Retrieving the job, via the Receive-Job cmdlet, consumes the data. You cannot come back and retrieve the returned data again. This code shown here illustrates this concept.<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Receive-Job $rtn<br \/>Invalid class<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>+ CategoryInfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: InvalidOperation: (:) [Get-WmiObject], ManagementException<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand<\/p>\n<p>PS C:&gt; Receive-Job get*<br \/>PS C:&gt; Receive-Job $rtn<br \/>PS C:&gt; <\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">This example also shows what happens when a scriptblock returns an error. When you use the Receive-Job the error message displays. To find additional information about the code that triggered the error, use the Job object stored in either the $rtn variable, or the GetSoftware named job. I prefer using the job object stored in the $rtn variable as seen here.<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; $rtn.Command<br \/>gwmi win32_software<br \/>PS C:&gt;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">There is no <b>Win32_software<\/b> WMI class. The correct WMI class is <b>Win32_product<\/b>. First, remove the leftover <b>job<\/b> objects by getting the jobs and removing the jobs. This is shown here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-Job | Remove-Job<br \/>PS C:&gt; Get-Job<br \/>PS C:&gt;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">When you create a new Windows PowerShell job, it runs in the background. There is no indication if the job ended in an error or if it was successful. Indeed, you do not have any idea when the job even completes, other than to use the <b>Get-Job<\/b> cmdlet several times to see when the job state changes from <b>Running<\/b> to <b>Completed<\/b>. For many jobs this may be perfectly acceptable. In fact, it may even be preferable because you wish to regain control of the Windows PowerShell console as soon as the job begins executing. On other occasions, you may want to be notified when the Windows PowerShell job completes. To do this, you can use the <b>Wait-Job<\/b> cmdlet. Give the <b>Wait-Job<\/b> cmdlet either a job name or a job ID. After you have done this, the Windows PowerShell console will pause until the job completes. The job is displayed on the console with its completed status. You can then use the retrieve job cmdlet to receive the deserialized objects and store them in a variable. As shown here, you can then use the <b>count<\/b> property to see how many software packages are installed on the computer:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; $rtn = Start-Job -ScriptBlock {gwmi win32_product}<br \/>PS C:&gt; $rtn<\/p>\n<p>Id<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>State<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>HasMoreData<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Location<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Command<br \/>&#8212;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;-<br \/>5<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Job5<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running<span>&nbsp;&nbsp;&nbsp; <\/span>True<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>localhost<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>gwmi win32_product<\/p>\n<p>PS C:&gt; Wait-Job -Id 5<\/p>\n<p>Id<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>State<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>HasMoreData<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Location<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Command<br \/>&#8212; <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;-<br \/>5<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Job5<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Completed<span>&nbsp; <\/span>True<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>localhost<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>gwmi win32_product<\/p>\n<p>PS C:&gt;<br \/>PS C:&gt; $prod = Receive-Job -Id 5<br \/>PS C:&gt; $prod.Count<br \/>145<br \/>PS C:&gt;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">In a newly open Windows PowerShell console, the <b>Start-Job<\/b> cmdlet is used to start a new job. The returned job object is stored in the <b>$rtn <\/b>variable. You can pipe the <b>job<\/b> object contained in the <b>$rtn<\/b> variable to the <b>Stop-Job<\/b> cmdlet to stop the execution of the job. If you try to use the <b>job<\/b> object in the <b>$rtn<\/b> variable directly to get job information, an error will be generated. This is shown here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; $rtn = Start-Job -ScriptBlock {gwmi win32_product}<br \/>PS C:&gt; $rtn | Stop-Job<br \/>PS C:&gt; Get-Job $rtn<br \/>Get-Job : The command cannot find the job because the System.Management.Automation.PSRemotingJob name was not found. Verify the value of the Name parameter, and then try the command again.<br \/>At line:1 char:8<br \/>+ Get-Job &lt;&lt;&lt;&lt;<span>&nbsp; <\/span>$rtn<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>+ CategoryInfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: ObjectNotFound: (System.Manageme&#8230;n.PSRemotingJob:String) [Get-\nJob], PSArgumentException<br \/><span>&nbsp;&nbsp;&nbsp; <\/span>+ FullyQualifiedErrorId : JobWithSpecifiedNameNotFound,Microsoft.PowerShell.Commands.GetJobCommand<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">You can pipe the job object to the <b>Get-Job<\/b> cmdlet and see that the job is in a stopped state. Use the <b>Receive-Job <\/b>cmdlet to receive the job information, and the <b>count<\/b> property to see how many software products are included in the variable, as shown here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; $rtn | Get-Job<\/p>\n<p>Id<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>State<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>HasMoreData<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Location<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Command<br \/>&#8212;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;-<br \/>1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Job1<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped<span>&nbsp;&nbsp;&nbsp; <\/span>True<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>localhost<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>gwmi win32_product<\/p>\n<p>PS C:&gt; $products = Receive-Job -Id 1<br \/>PS C:&gt; $products.count<br \/>73<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">In the above list you can see that only 73 software packages were enumerated. This is because the <b>Get-Wmiobject<\/b> command to retrieve information from the <b>Win32_Product<\/b> class did not have time to finish. In fact, it was stopped about half way in progress. If you wish to see the name of all the installed software packages, pipe the received job items (stored in the <b>$products<\/b> variable) to the <b>Select-Object<\/b> cmdlet and choose the name. The output is shown here, in truncated fashion:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; $products | Select name<\/p>\n<p>Name<br \/>&#8212;-<br \/>XML Notepad 2007<br \/>PowerShellPack<br \/>Catalyst Control Center InstallProxy<br \/>Microsoft Office Visio Professional 2007<br \/>Microsoft Office OneNote MUI (English) 2007<br \/>Microsoft Office Groove Setup Metadata MUI (English) 2007<br \/>Microsoft Office InfoPath MUI (English) 2007<br \/>Microsoft Office Visio MUI (English) 2007<br \/>Microsoft Office Access MUI (English) 2007<br \/>Microsoft Office Shared Setup Metadata MUI (English) 2007<br \/>Microsoft Office Excel MUI (English) 2007<br \/>Microsoft Office Shared 64-bit Setup Metadata MUI (English) 2007<br \/>Microsoft Office Access Setup Metadata MUI (English) 2007<br \/>Microsoft Office PowerPoint MUI (English) 2007<br \/>Microsoft Office Publisher MUI (English) 2007<br \/>Microsoft Office Outlook MUI (English) 2007<br \/>Microsoft Office Office 64-bit Components 2007<br \/>Microsoft Office Shared 64-bit MUI (English) 2007<br \/>Microsoft Office Groove MUI (English) 2007<br \/>&hellip;Truncated output &hellip;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">To see all the job related cmdlets, use the <b>Get-Command<\/b> cmdlet with the <b>&ndash;noun<\/b> parameter and look for things related to jobs. Use the <b>Select-Object<\/b> cmdlet to retrieve only the cmdlet names. This is shown here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-Command -Noun *job* | Select-Object name<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><\/p>\n<p><font face=\"Lucida Sans Typewriter\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Name<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">&#8212;-<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Get-Job<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Receive-Job<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Remove-Job<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Start-Job<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Stop-Job<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Wait-Job<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"CodeBlock\"><span><\/p>\n<p><font face=\"Lucida Sans Typewriter\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"CodeBlock\"><span><\/p>\n<p><font face=\"Lucida Sans Typewriter\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">BP, at this point, we have now looked at all six of the job-related Windows PowerShell cmdlets. Windows PowerShell Jobs Week will continue tomorrow. <\/p>\n<p class=\"MsoNormal\">If you want to know exactly what we will be looking at tomorrow, follow us on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\"><font face=\"Segoe\">Twitter<\/font><\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\"><font face=\"Segoe\">Facebook<\/font><\/a>. If you have any questions, send e-mail to us at <a href=\"http:\/\/blogs.technet.commailto:scripter@microsoft.com\" target=\"_blank\"><font face=\"Segoe\">scripter@microsoft.com<\/font><\/a> or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\"><font face=\"Segoe\">Official Scripting Guys Forum<\/font><\/a>. See you tomorrow. Until then, peace.<\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p><b><span>Ed Wilson and Craig Liebendorfer, Scripting Guys<\/p>\n<p><\/span><\/b><\/p>\n<p><p>&nbsp;<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; Hey, Scripting Guy! I am not sure how much help running the Get-Process cmdlet as a job is going to be for me in my work environment. I kind of get what you are trying to do&mdash;provide an illustrative technique for working with Windows PowerShell jobs&mdash;but I have things that take a really [&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,85,3,4,45],"class_list":["post-50973","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-getting-started","tag-jobs","tag-scripting-guy","tag-scripting-techniques","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; &nbsp; Hey, Scripting Guy! I am not sure how much help running the Get-Process cmdlet as a job is going to be for me in my work environment. I kind of get what you are trying to do&mdash;provide an illustrative technique for working with Windows PowerShell jobs&mdash;but I have things that take a really [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/50973","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=50973"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/50973\/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=50973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=50973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=50973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}