{"id":137,"date":"2007-05-23T14:26:47","date_gmt":"2007-05-23T22:26:47","guid":{"rendered":"http:\/\/testblog.sapien.com\/index.php\/2007\/05\/23\/do-you-get-it\/"},"modified":"2007-05-23T14:26:47","modified_gmt":"2007-05-23T22:26:47","slug":"do-you-get-it","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2007\/05\/23\/do-you-get-it\/","title":{"rendered":"Do you &#8220;get it?&#8221;"},"content":{"rendered":"<p>In his blog at <a href=\"http:\/\/4sysops.com\/archives\/free-windows-powershell-book-or-why-powerscript-would-have-been-a-better-name\/\">http:\/\/4sysops.com\/archives\/free-windows-powershell-book-or-why-powerscript-would-have-been-a-better-name\/<\/a>, Michael has a lot to say about his first thoughts about Windows PowerShell. Unfortunately, I think he may have missed a few salient points, and may just not &#8220;get it&#8221; yet. That&#8217;s easy to do with PowerShell &#8211; it&#8217;s a new way of thinking about things, and it requires you to acknowledge some realities about Windows that many administrators just aren&#8217;t comfortable owning up to.<\/p>\n<blockquote>\n<p>Actually, you could also say, it is an <a href=\"https:\/\/blogs.technet.com\/chitpro-de\/archive\/2007\/05\/10\/english-version-of-windows-powershell-course-book-available-for-download.aspx\"><font style=\"color: #7098cc\" color=\"#7098cc\">introduction into Windows Powershell<\/font><\/a> from Microsoft. When I skimmed over the document, I came once again to the conclusion that <strong><font style=\"color: #666666\" color=\"#666666\">Powershell is not really a shell, but just another scripting language<\/font><\/strong>.<\/p>\n<\/blockquote>\n<p><span id=\"more-541\">It&#8217;s actually both, just like the shells used by most Unix admins (Bash and so forth). You can do incredibly powerful things with PowerShell without writing a line of script &#8220;code.&#8221; In fact, Cmd.exe is the same thing, no? It&#8217;s a shell, but it does have a (primitive) scripting language embedded in it, as well. I&#8217;m not sure a &#8220;skim&#8221; is the best way to learn about PowerShell &lt;grin&gt;!<\/span><\/p>\n<blockquote>\n<p>This is at least true if you take the original meaning of the term &ldquo;<strong><font style=\"color: #666666\" color=\"#666666\">shell<\/font><\/strong>&rdquo; which is just a <strong><font style=\"color: #666666\" color=\"#666666\">user interface<\/font><\/strong>. Of course, you can also use Powershell on the command prompt. However, I doubt that many Windows sysops will really do this. <\/p>\n<\/blockquote>\n<p>Wow, I couldn&#8217;t agree more. Why do most Unix admins choose to work from a command shell? Easier, more consistent, more efficient. Why have Unix admins always given Windows a hard time in manageability brownie points? The lack of a cohesive, complete command-line shell. I&#8217;ve been flying all over the country in the past few weeks &#8211; and will fly more in the weeks to come &#8211; teaching eager Windows sysops how to use PowerShell, and they&#8217;re loving it. Funny you should use the word &#8220;sysop,&#8221; in fact, Michael &#8211; I didn&#8217;t think anyone did anymore! But just this week I was teaching a bunch of sysops who work for Google (yup, they use Windows, and lots of it) how to use PowerShell &#8211; and believe me, they &#8220;get it.&#8221;<\/p>\n<p>Consider this example from the book which lists processes by its name and CPU time:<\/p>\n<blockquote>\n<p>get-process | ForEach-Object { write-host $_.ProcessName $_.CPU}<\/p>\n<p><strong><font style=\"color: #666666\" color=\"#666666\">Who really wants to type such longwinded commands?<\/font><\/strong> Yeah, you could also just use &ldquo;get-process&rdquo; to get a (different kind of) list of processes. But why not just use task manager for this? The point is, you usually need such a formatted list of processes only if you want to use it as input for another command. And that&rsquo;s what I call scripting and not working on the command shell. Therefore, a better name for Powershell would have been &ldquo;Powerscript&rdquo; in my view.<\/p>\n<\/blockquote>\n<p dir=\"ltr\">It&#8217;s easy to think thaty when you&#8217;re getting started. But consider this: You know what that&#8217;s doing, because those long-winded cmdlet names are very clear about what they&#8217;re up to. And if you want pithy:<\/p>\n<blockquote>\n<p dir=\"ltr\">ps | select ProcessName,CPU<\/p>\n<\/blockquote>\n<p dir=\"ltr\"><font style=\"color: #666666\" color=\"#666666\"><font style=\"color: #181818\" color=\"#181818\">Short-winded enough? As with any product, you do have to take the time to <em>learn how to use it properly and efficiently. <\/em>That was the case when you started learning Windows&#8217; graphical user interface, as well, and the same applies for PowerShell.<\/font><\/font><\/p>\n<blockquote>\n<p dir=\"ltr\"><font style=\"color: #666666\" color=\"#666666\"><strong>I think that Windows doesn&rsquo;t really need a powerful command shell<\/strong><\/font> because it has very powerful GUI tools. This is the main difference to Linux. However, there are some tasks you can&rsquo;t even do with a powerful GUI. But then they are usually so complicated that a longwinded command won&rsquo;t be of help either. That&rsquo;s were scripts come in.<\/p>\n<\/blockquote>\n<p dir=\"ltr\">Well, I just couldn&#8217;t disagree more! Let&#8217;s take a simple example: Changing the logon name a service uses. Can&#8217;t do it through the GUI, and with PowerShell <em>you don&#8217;t need to write a script. <\/em>You can do it in one nice command line &#8211; <em>if<\/em> you know how to use the shell. Yes, learning is involved &#8211; it&#8217;s the IT industry; learning will <em>always<\/em>&nbsp; be happening. Windows&#8217; GUI, as I&#8217;ve said, makes Windows easy to use for one-off tasks; when you need to do something in batch, or consistently, or when the GUI presentation happens to be complex, Windows falls down. Yep, it&#8217;s a major difference from Unix or Linux &#8211; and it&#8217;s why those guys <em>kill<\/em> us in enterprise manageability. Hence, PowerShell.<\/p>\n<blockquote>\n<p>On my blog someone asked <a href=\"\/archives\/windows-server-longhorn-server-core-essentials\/#comment-16229\"><font style=\"color: #7098cc\" color=\"#7098cc\">why Sever Core doesn&rsquo;t support Powershell<\/font><\/a>. The official answer to this question is that Powershell needs .Net which is not supported by Server Core. Another reason is that Server Core wouldn&rsquo;t probably benefit much from Powershell because it is a scripting language and not a command shell.<\/p>\n<\/blockquote>\n<p>Michael, with all the respect in the world, you&#8217;re just dead wrong. It is a command shell &#8211; I suspect you just don&#8217;t have enough experience with it yet to realize that. You&#8217;re right in that Server Core won&#8217;t run PowerShell because of the .NET requirement; hopefully that&#8217;s something Microsoft will work on. However, I&#8217;ll suggest this: <em>Windows admins need to get the heck out of this habit of managing servers from the servers&#8217; console. <\/em>Server Core is intended to be &#8220;headless;&#8221; you <em>don&#8217;t<\/em> log on to its console. You manage it remotely &#8211; something you could really do with any Windows server; Server Core just pushes the point harder. If you&#8217;re actually walking into your data center, you&#8217;re working too hard.<\/p>\n<p>Now, leaving Michael alone for a minute, I want to make an observation: For folks whose chosen profession is an always-evolving one (e.g., IT), Windows admins seem remakrably reluctant to change their ways. Managing servers by logging onto the console has been a ridiculous, time-consuming, error-ridden process for years, and since at least 2000-2003, it hasn&#8217;t been necessary. Managing entirely from a GUI is also inefficient and inconsistent, although to date it&#8217;s still necessary &#8211; although PowerShell is the start of that changing. It&#8217;s frustrating for me to see people still doing things like walking into the data center to reboot a machine, or change a service, or create a user &#8211; but they still do it. Folks, if you decide you want to be stuck in time and use products like Windows in the most inefficient way they allow &#8211; well, more power to you! But products like Windows PowerShell are intended to fix what the rest of the industry has long perceived as grave shortcomings; if you don&#8217;t think a GUI is inefficient or inconsistent, then you don&#8217;t have to change &#8211; but recognize that tens of thousands of people disagree with you, so there&#8217;s the slightest chance you might be mistaken.<\/p>\n<p>I hope <em>every<\/em> Windows administrator takes some time to really learn what PowerShell is about (not just&nbsp;a quick skim, although that&#8217;s certainly a great start). Be a <em>professional<\/em> in the IT industry. Accept that the way we&#8217;ve always managed Windows isn&#8217;t because that way is better &#8211; it&#8217;s because that way is all we had. Turn to operating systems like Unix &#8211; which have a 20-year head start on us in manageability &#8211; and learn a few lessons. Take the best of what they offer, and keep the best of what Windows offers &#8211; which is why I truly believe PowerShell is doing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In his blog at http:\/\/4sysops.com\/archives\/free-windows-powershell-book-or-why-powerscript-would-have-been-a-better-name\/, Michael has a lot to say about his first thoughts about Windows PowerShell. Unfortunately, I think he may have missed a few salient points, and may just not &#8220;get it&#8221; yet. That&#8217;s easy to do with PowerShell &#8211; it&#8217;s a new way of thinking about things, and it requires you to acknowledge some realities about Windows that many administrators just aren&#8217;t comfortable owning up to.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-windows-powershell"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=137"}],"version-history":[{"count":0,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/137\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}