{"id":313,"date":"2010-04-05T20:50:08","date_gmt":"2010-04-06T01:50:08","guid":{"rendered":"http:\/\/jamesdevine.info\/?p=313"},"modified":"2021-07-01T12:24:35","modified_gmt":"2021-07-01T17:24:35","slug":"prompt-a-user-for-input-in-powershell","status":"publish","type":"post","link":"https:\/\/jamesdevine.info\/index.php\/2010\/04\/prompt-a-user-for-input-in-powershell\/","title":{"rendered":"Prompt a User for Input In Powershell"},"content":{"rendered":"<p>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.<\/p>\n<pre>$input=read-host \"Hey user, enter some text!\"<\/pre>\n<p>The text that enters in the above example is save in the $input variable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Occasionally it is necessary to prompt a user for input in a Powershell script. In my case I just need [&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":[38,19],"tags":[],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-powershell","category-windows"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":306,"url":"https:\/\/jamesdevine.info\/index.php\/2010\/03\/background-jobs-in-powershell\/","url_meta":{"origin":313,"position":0},"title":"Background Jobs In Powershell","author":"James Devine","date":"March 16, 2010","format":false,"excerpt":"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. Powershell 2 support running scripts in the background with a simple command. The only\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":309,"url":"https:\/\/jamesdevine.info\/index.php\/2010\/03\/automate-website-visits-with-powershell-and-internet-explorer\/","url_meta":{"origin":313,"position":1},"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;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/jamesdevine.info\/index.php\/category\/windows\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":380,"url":"https:\/\/jamesdevine.info\/index.php\/2011\/12\/nx-os-tftp\/","url_meta":{"origin":313,"position":2},"title":"NX-OS TFTP","author":"James Devine","date":"December 2, 2011","format":false,"excerpt":"Typically on Cisco IOS the copy command will use the default\u00a0management\u00a0interface for TFTP traffic. After quite a bit of throubleshooting I found out this is not the case with the NX-OS. You need to put in a vrf. By default for the management interface 'management' must be entered. Nexus_5010_Switch# copy\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":330,"url":"https:\/\/jamesdevine.info\/index.php\/2010\/05\/getting-hadoop-mapreduce-0-20-2-running-on-ubuntu\/","url_meta":{"origin":313,"position":3},"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;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/jamesdevine.info\/index.php\/category\/linux\/"},"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":147,"url":"https:\/\/jamesdevine.info\/index.php\/2009\/03\/6-tips-to-stay-safe-on-the-internet\/","url_meta":{"origin":313,"position":4},"title":"6 Tips to Stay Safe on the Internet","author":"James Devine","date":"March 31, 2009","format":false,"excerpt":"1.) If you receive a suspicious email don't open it! If you get an email from a website that you do not have an account at just delete it. A lot of viruses and attacks will try to look like a legitimate message from a bank or other website like\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/jamesdevine.info\/index.php\/category\/windows\/"},"img":{"alt_text":"real_link_name1","src":"https:\/\/i0.wp.com\/jamesdevine.info\/wp-content\/uploads\/2009\/03\/real_link_name1-300x216.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/posts\/313","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=313"}],"version-history":[{"count":2,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":504,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/posts\/313\/revisions\/504"}],"wp:attachment":[{"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/media?parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/categories?post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jamesdevine.info\/index.php\/wp-json\/wp\/v2\/tags?post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}