{"id":306,"date":"2010-03-16T18:05:52","date_gmt":"2010-03-16T23:05:52","guid":{"rendered":"http:\/\/jamesdevine.info\/?p=306"},"modified":"2010-03-31T20:48:09","modified_gmt":"2010-04-01T01:48:09","slug":"background-jobs-in-powershell","status":"publish","type":"post","link":"https:\/\/jamesdevine.info\/index.php\/2010\/03\/background-jobs-in-powershell\/","title":{"rendered":"Background Jobs In Powershell"},"content":{"rendered":"<p>I have been doing a lot of powershell scripting for my senior thesis. I had the need to run a\u00a0background\u00a0job and did not find helpful information through searching Google so I figured I would post this.<\/p>\n<p>Powershell 2 support running scripts in the background with a simple command. The only caveat is that it will only run other powershell scripts.<\/p>\n<p><strong>Start a background job:\u00a0<span style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-weight: normal; line-height: 18px; font-size: 12px; white-space: pre;\">$job=start-job &#8220;script.ps1&#8221;<\/span><\/strong><\/p>\n<p><strong>Wait for the job to finish:\u00a0<span style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-weight: normal; line-height: 18px; font-size: 12px; white-space: pre;\">wait-job($job)<\/span><\/strong><\/p>\n<p><span style=\"font-family: Consolas, Monaco, 'Courier New', Courier, monospace;\"><span style=\"line-height: 18px; white-space: pre; font-size: small;\"><br \/>\n<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been doing a lot of powershell scripting for my senior thesis. I had the need to run a\u00a0background\u00a0job [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1,19,38],"tags":[],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-general-information","category-windows","category-powershell"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":309,"url":"https:\/\/jamesdevine.info\/index.php\/2010\/03\/automate-website-visits-with-powershell-and-internet-explorer\/","url_meta":{"origin":306,"position":0},"title":"Automate Website Visits With Powershell and Internet Explorer","author":"James Devine","date":"March 31, 2010","format":false,"excerpt":"For my research I found the need to automatically visit a webpage to run a setup and a teardown script. Turns out that it is fairly easy to do. The script is included below. #cd to Internet Explorer cd \"C:\\Program Files\\Internet Explorer\" #point ie to the teardown script .\/iexplore.exe 10.0.0.20\/teardown.php\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/jamesdevine.info\/index.php\/category\/general-information\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":313,"url":"https:\/\/jamesdevine.info\/index.php\/2010\/04\/prompt-a-user-for-input-in-powershell\/","url_meta":{"origin":306,"position":1},"title":"Prompt a User for Input In Powershell","author":"James Devine","date":"April 5, 2010","format":false,"excerpt":"Occasionally it is necessary to prompt a user for input in a Powershell script. In my case I just need to remind the user to do something, but the same command can get the user input and store it in a variable. $input=read-host \"Hey user, enter some text!\" The text\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/jamesdevine.info\/index.php\/category\/windows\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":330,"url":"https:\/\/jamesdevine.info\/index.php\/2010\/05\/getting-hadoop-mapreduce-0-20-2-running-on-ubuntu\/","url_meta":{"origin":306,"position":2},"title":"Getting Hadoop MapReduce 0.20.2 Running On Ubuntu","author":"James Devine","date":"May 9, 2010","format":false,"excerpt":"I decided to setup a Hadoop cluster and write a MapReduce job \u00a0for my distrbuted systems final project. I had done this before with an earlier release and it was fairly straight forward. It turns out it is still straight forward with Hadoop 0.20.2, but the process is not well\u2026","rel":"","context":"In &quot;Systems&quot;","block_context":{"text":"Systems","link":"https:\/\/jamesdevine.info\/index.php\/category\/systems\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2010\/05\/network.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":541,"url":"https:\/\/jamesdevine.info\/index.php\/2021\/12\/five-traits-of-highly-effective-solution-architects\/","url_meta":{"origin":306,"position":3},"title":"Five Traits of Highly Effective Solution Architects","author":"James Devine","date":"December 29, 2021","format":false,"excerpt":"The role of Solutions Architect is one of the most versatile, challenging, and rewarding positions I've personally had. I've worked alongside hundreds of such folks across roles and companies and think the following five traits are at the heart of all those that I would consider highly effective.","rel":"","context":"In &quot;Systems&quot;","block_context":{"text":"Systems","link":"https:\/\/jamesdevine.info\/index.php\/category\/systems\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/12\/good-sa-illustrate-scaled.jpeg?fit=1200%2C674&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/12\/good-sa-illustrate-scaled.jpeg?fit=1200%2C674&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/12\/good-sa-illustrate-scaled.jpeg?fit=1200%2C674&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/12\/good-sa-illustrate-scaled.jpeg?fit=1200%2C674&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/12\/good-sa-illustrate-scaled.jpeg?fit=1200%2C674&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":462,"url":"https:\/\/jamesdevine.info\/index.php\/2021\/07\/vsphere-7-home-lab-build-saga-complete-overhaul\/","url_meta":{"origin":306,"position":4},"title":"vSphere 7 Home Lab Build Saga &#8211; Complete Overhaul","author":"James Devine","date":"July 1, 2021","format":false,"excerpt":"One of my pandemic projects that may have gotten a bit out of hand was building a vSphere home lab. The initial plan was to simply upgrade a 7-year-old standalone ESXi server, but quickly turned into buying a 1\/4 height rack.","rel":"","context":"In &quot;Virtualization&quot;","block_context":{"text":"Virtualization","link":"https:\/\/jamesdevine.info\/index.php\/category\/topics-in-virtualization\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/07\/vsphere-illustrate_ccexpress-scaled.jpeg?fit=1200%2C674&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/07\/vsphere-illustrate_ccexpress-scaled.jpeg?fit=1200%2C674&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/07\/vsphere-illustrate_ccexpress-scaled.jpeg?fit=1200%2C674&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/07\/vsphere-illustrate_ccexpress-scaled.jpeg?fit=1200%2C674&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2021\/07\/vsphere-illustrate_ccexpress-scaled.jpeg?fit=1200%2C674&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":362,"url":"https:\/\/jamesdevine.info\/index.php\/2010\/05\/run-internet-explorer-7-on-vista-and-windows-7\/","url_meta":{"origin":306,"position":5},"title":"Run Internet Explorer 7 On Vista and Windows 7","author":"James Devine","date":"May 13, 2010","format":false,"excerpt":"I do a lot of web development and constantly switch back and forth between browers to make sure that sites look the same. Since I run Windows 7 my choice of what version of Internet Explorer I can use is limited to IE8. However it turns out that there is\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/jamesdevine.info\/index.php\/category\/general-information\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2010\/05\/ie7.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2010\/05\/ie7.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2010\/05\/ie7.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2010\/05\/ie7.jpg?resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":3,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":312,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/posts\/306\/revisions\/312"}],"wp:attachment":[{"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}