{"id":16151,"date":"2010-12-21T00:01:00","date_gmt":"2010-12-21T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/12\/21\/a-windows-powershell-carol-ebenezer-script-integrates-with-vbscript\/"},"modified":"2010-12-21T00:01:00","modified_gmt":"2010-12-21T00:01:00","slug":"a-windows-powershell-carol-ebenezer-script-integrates-with-vbscript","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/a-windows-powershell-carol-ebenezer-script-integrates-with-vbscript\/","title":{"rendered":"A Windows PowerShell Carol: Ebenezer Script Integrates with VBScript"},"content":{"rendered":"<p><span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<b><span style=\"font-size:10.0pt\">Summary:<\/span><\/b><span style=\"font-size:10.0pt\"> A Windows PowerShell Carol in which Ebenezer Script learns how to integrate VBScript with PowerShell.<\/span>\n<span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Question\" border=\"0\" title=\"Hey, Scripting Guy! Question\"><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Hey, Scripting Guy! Will Ebenezer Script learn how to integrate VBScript with Windows PowerShell?<\/span>\n<span style=\"font-size:10.0pt\">&#8212; JS<\/span>\n<span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Answer\" border=\"0\" title=\"Hey, Scripting Guy! Answer\"><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>Hello JS, Microsoft Scripting Guy Ed Wilson here. It is almost the end of the year and we have decided to devote some posts to the holiday season. We even have guest bloggers from around the world to share some holiday spirit. This week we have Sean Kearney. You can learn more about Sean in <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2010\/12\/19\/weekend-scripter-holiday-powershell-carol-part-one.aspx\"><span>Monday&rsquo;s blog introduction<\/span><\/a>. Be sure to check out <a href=\"https:\/\/www.youtube.com\/watch?v=v04BXhlPxyY\">Sean&rsquo;s theme song for this week&rsquo;s PowerShell Carol posts<\/a>.<\/span>\n<span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\">Ebenezer&rsquo;s eyes cleared as he looked up. It was Clippy, Jacob Clippy, back from the dead (or wherever retired Office Assistants go).<\/span>\n<span style=\"font-size:10.0pt\">Jacob moved and a large rattling sound echoed loudly through the room. Ebenezer looked up. A thousand large, blocky yet somehow familiar objects hung off his legs connected by long, thin, gray cables.<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Ebenezer, you have become a miserable Administrator; cruel &#8212; foul and detestable.&rdquo; <\/span>\n<span style=\"font-size:10.0pt\">The air filled with Jacob Clippy&rsquo;s words.<\/span>\n<span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Why thank you. I do try you know,&rdquo; muttered old Mr. Script.<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Nooooo! You should not dwell and be proud of those ways! For every joy I removed from a user; a 10 MB drive is attached to my leg!&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;10 MB? Bah! Why I could carry that many floppies without a challenge!&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;No, Ebenezer,&rdquo; Clippy blinked, &ldquo;but a 10 MB full height MFM hard drive <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/ee198910.aspx\">for each<\/a> user&rsquo;s joy. Let me remind you, I irritated a LOT of people; this is heavy chain I carry. There is such a chain for you my friend, for you are already forging one away. Yet yours is twice as large and formed from old Battery backups.&ldquo;<\/span>\n<span style=\"font-size:10.0pt\">Ebenezer was about to faint until Jacob Clippy poked him. <\/span>\n<span style=\"font-size:10.0pt\">&ldquo;There is still time for you to change. You will be visited by THREE spirits tonight.&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Clippy,&rdquo; Ebenezer quickly spoke up, &ldquo;this sounds vaguely like you are copying some OTHER famous Holiday story.&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;It is parody so within legal guidelines; and you have little time to speak, Oh Crotchety One. As I said, three spirits will visit you this evening to try and save you from the fate I carved out for myself.&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">Ebenezer looked up. An eternity with technology did not sound so bad, but battery backups were never meant to be moved. He wondered if they come with a pushcart for the batteries.<\/span>\n<span style=\"font-size:10.0pt\">As if knowing his thoughts, Jacob muttered, &ldquo;&hellip;and you will not get a push cart you cantankerous toad.&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">Jacob Clippy pulled out a thin device called a &ldquo;Slate&rdquo; and invoked Windows PowerShell. <\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Ebenezer, what do you see here?&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">The old scripter glanced. <\/span>\n<span style=\"font-size:10.0pt\">&ldquo;I see nothing more than a blue looking command prompt! It&rsquo;s that blasted Windows PowerShell! Useless! It&rsquo;s separate from VBScript. I&rsquo;d have to learn everything all over again! It&rsquo;s CODEBUG!&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;I see. So how would you launch a VBScript normally?&rdquo; the Spirit glanced over at his old friend.<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;You dead old fool, to launch a VBScript application all I need to do it this.&rdquo;<\/span><\/p>\n<blockquote>\n<p class=\"CodeBlockScreened\"><span style=\"font-family: courier new,courier\">CSCRIPT.EXE Appname.vbs<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\">Jacob Clippy looked down at his old friend. &ldquo;Would it surprise you to know that is how you launch it from Windows PowerShell, and that it can pass parameters directly to your original VBScripts?&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">Ebenezer shook his head, &ldquo;Bah! &lsquo;Tis all a load of Codebug!&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">Jacob keyed in two small scripts.<\/span>\n<span style=\"font-size:10.0pt\">The first was in VBScript.<span>&nbsp; <\/span>A simple one line script that was saved as <b>myscript.vbs<\/b> in a file. <\/span><\/p>\n<blockquote>\n<p class=\"CodeBlockScreened\"><span style=\"font-family: courier new,courier\">wscript.echo wscript.arguments(0) &amp;<span>&nbsp; <\/span>&#8221; is being Visited by a Spirit!&#8221; <\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\">The second was in Windows PowerShell. It looked like this:<\/span><\/p>\n<blockquote>\n<p class=\"CodeBlockScreened\"><span style=\"font-family: courier new,courier\">$Name=READ-HOST &ldquo;Enter a Name here&rdquo;<\/span><\/p>\n<p class=\"CodeBlockScreened\"><span style=\"font-family: courier new,courier\">Cscript.exe myscript.vbs<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\">He ran <b>.\/JACOB.PS1<\/b> and filled in Ebenezer&rsquo;s name. Its response was:<\/span><\/p>\n<blockquote>\n<p class=\"CodeBlockScreened\"><span style=\"font-family: courier new,courier\">&ldquo;Ebenezer is being Visited by a Spirit!&rdquo;<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\">For a moment, the Spirit saw a spark of possibility hit his old friend&rsquo;s eyes when the two technologies merged seamlessly.<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Ebenezer, I do not understand you. You still seem to love to script, yet so angry at new scripting and technologies. I see the spark that once lit your eyes when we launched that script. That old spark I once knew. Perhaps the night will yield a future you cannot foresee.&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">With a blink, Clippy faded into the night, the last thing Ebenezer saw was his two oversized catatonic eyeballs.<\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Spirits in the night,&rdquo; thought Ebenezer, &ldquo;more like Ghosts in the Machine.&rdquo;<\/span>\n<span style=\"font-size:10.0pt\">The grumpy old fellow wandered up the stairs, tripping on the occasionally floppy. <\/span>\n<span style=\"font-size:10.0pt\">&ldquo;Bah! Codebug!&rdquo; was all that could be heard under his breath as he was heading up the stairs to sleep.<\/span>\n<span style=\"font-size:10.0pt\">Will Ebenezer stop having strange visions of giant, floating paperclips? Will the Three Spirits REALLY visit him tonight? Will the lawyers for a famous British person chase after the writer for use of parody? These and more questions answered (or not, as is the writer&rsquo;s discretion).<\/span>\n<span style=\"font-size:10.0pt\">&nbsp;<\/span>\n<span style=\"font-size:10.0pt\">JS, that is all there is to using Windows PowerShell and VBScript together.<span>&nbsp; <\/span>Holiday guest blogger week will continue tomorrow. <\/span>\n<span style=\"font-size:10.0pt\">I invite you to follow me on <a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send email to me at <a target=\"_blank\" href=\"http:\/\/blogs.technet.commailto:scripter@microsoft.com\">scripter@microsoft.com<\/a> or post them on the <a href=\"http:\/\/social.technet.microsoft.com\/Forums\/en\/ITCG\/threads\/\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/span>\n<span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n<p><b><span style=\"font-size:10.0pt\">Ed Wilson, Microsoft Scripting Guy<\/span><\/b><span style=\"font-size:10.0pt\">&nbsp;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Summary: A Windows PowerShell Carol in which Ebenezer Script learns how to integrate VBScript with PowerShell. &nbsp; Hey, Scripting Guy! Will Ebenezer Script learn how to integrate VBScript with Windows PowerShell? &#8212; JS &nbsp; Hello JS, Microsoft Scripting Guy Ed Wilson here. It is almost the end of the year and we have decided [&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":[56,3,4,154,155,45],"class_list":["post-16151","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-guest-blogger","tag-scripting-guy","tag-scripting-techniques","tag-sean-kearney","tag-vbscript-migration","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; Summary: A Windows PowerShell Carol in which Ebenezer Script learns how to integrate VBScript with PowerShell. &nbsp; Hey, Scripting Guy! Will Ebenezer Script learn how to integrate VBScript with Windows PowerShell? &#8212; JS &nbsp; Hello JS, Microsoft Scripting Guy Ed Wilson here. It is almost the end of the year and we have decided [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16151","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=16151"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16151\/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=16151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=16151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=16151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}