{"id":8611,"date":"2007-01-31T00:21:29","date_gmt":"2007-01-31T00:21:29","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2007\/01\/31\/powershell-benefits-over-com-scripting\/"},"modified":"2019-02-18T13:20:47","modified_gmt":"2019-02-18T20:20:47","slug":"powershell-benefits-over-com-scripting","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/powershell-benefits-over-com-scripting\/","title":{"rendered":"PowerShell Benefits Over  COM Scripting"},"content":{"rendered":"<p><span style=\"color:#1f497d;font-size:12pt\">On an internal email thread, someone asked Vivek Sharma why they should implement PowerShell.  They knew that PowerShell provided scripting but they had a COM interface which already gave them scripting so the question was \u2013 what, if any, were the additional benefits to doing PowerShell.  Vivek gave a great answer that I thought I would share with you:<br \/>\n\t\t<\/span><\/p>\n<ul>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>Rich Cmdline based interface\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">COM == developer experience NOT admin experience. Admins are not programmers. Admins don&#8217;t want to install Visual studio to &#8220;manage&#8221; their servers.\n<\/span><\/li>\n<li><span style=\"color:#1f497d;font-size:12pt\">Cmdline creates a virtuous cycle between the user and the system. Contrary to current scripting engines, you can actually safely experiment through the cmdline to create scripts. Again, without this interactive experience, admins are lost when it comes to scripting.\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>More secure scripting engine\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">PowerShell supports cert based signed scripts and by default is super restricted in operation\n<\/span><\/li>\n<li><span style=\"color:#1f497d;font-size:12pt\">PowerShell support group policy based control of the environment\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>100% consistency between our user interfaces\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">Now that everything runs through PowerShell in our management UIs, users are guaranteed that they see the same validation, errors, behavior across the board. Consistency == happier users\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>Its easier and more flexible to build user interfaces as the business logic is encapsulated outside of the user interface layer\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">Since there is one authoritative layer (PowerShell Cmdlets) that contain business logic, we have flexibility in our UI. For example, if we went to wed admin in the future, we only have to rewrite our UI bits, but can carry forward our Cmdlet business logic\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>100% automation for every single management operation in Exchange\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">What we think should be automatable is different than what users expect. Since PowerShell gives us an easier way to develop management software we can get to 100% automation easier than before\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>100% automatable setup\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">Our setup is PowerShell based and is essentially script based. You can do a complete lights-out setup for Exchange on a server using our setup.exe and PowerShell scripts \u00a0\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>Consistent 3<sup>rd<\/sup> party and partner story\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">We used to have a variety of APIs: COM, WMI etc. None of them were complete or consistent. By forcing ourselves to consume PowerShell, we ultimately shipped one API that is 100% comprehensive&#8212;what we use is exactly what 3<sup>rd<\/sup> parties use.\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>Faster development for component teams\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">We use a &#8220;self-service&#8221; model where each team in Exchange builds their own Cmdlets. This a) allows them to develop management of their feature while writing the feature and b) allows better management of the feature as the feature expert is building the Cmdlets. Users benefit from the higher quality, component teams are essentially &#8220;in control&#8221; of their features.\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>Better management testability\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">Since component teams build Cmdlets while they build a feature, they can unblock the test team to test the feature using real code. In the past the GUI team was the long pole in a ship cycle as they built the management for the whole Exchange team. In the self-service model component teams are &#8220;unblocked&#8221; from this bottle neck and can start their testing much earlier.\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>Internal infrastructure improvements\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">Since everything management related is 100% automatable, our daily tests and BVTs actually use PowerShell scripts as part of the Exchange automated testing. This means less one-off code has to be rewritten in order to automatically test Exchange\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li>\n<div><span style=\"color:#1f497d;font-size:12pt\"><strong>Better together\n<\/strong><\/span><\/div>\n<ul>\n<li><span style=\"color:#1f497d;font-size:12pt\">We expect our admins to leverage PowerShell to manage other related services \/ products in a similar fashion as Exchange&#8212;since PowerShell has a great cross-product composability model, it is much easier for our admins if everyone is using Powershell.\n<\/span><\/li>\n<\/ul>\n<\/li>\n<li><span style=\"color:#1f497d;font-size:12pt\"><strong>Plus it&#8217;s just plain cool and is constantly winning the hearts and minds of our customers.\n<\/strong><\/span><\/li>\n<\/ul>\n<p>\n\u00a0<\/p>\n<p><span style=\"color:#1f497d;font-size:12pt\">Any guesses why I&#8217;m a charter member of the Vivek Sharma fan club?\n<\/span><\/p>\n<p><span style=\"color:#1f497d;font-size:12pt\">The Exchange team totally got PowerShell when other people looked at us like we had a rat&#8217;s tail hanging out of our mouths.  They are a high IQ team.\n<\/span><\/p>\n<p><span style=\"font-size:12pt\"><span style=\"color:#1f497d\">Jeffrey Snover [MSFT]<br \/>Windows PowerShell\/MMC Architect<br \/>Visit the Windows PowerShell Team blog at:    <a href=\"http:\/\/blogs.msdn.com\/PowerShell\" \/><\/span>http:\/\/blogs.msdn.com\/PowerShell<span style=\"color:#1f497d\"><br \/>Visit the Windows PowerShell ScriptCenter at:  http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\n<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On an internal email thread, someone asked Vivek Sharma why they should implement PowerShell. They knew that PowerShell provided scripting but they had a COM interface which already gave them scripting so the question was \u2013 what, if any, were the additional benefits to doing PowerShell. Vivek gave a great answer that I thought I [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8611","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>On an internal email thread, someone asked Vivek Sharma why they should implement PowerShell. They knew that PowerShell provided scripting but they had a COM interface which already gave them scripting so the question was \u2013 what, if any, were the additional benefits to doing PowerShell. Vivek gave a great answer that I thought I [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/8611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=8611"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/8611\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=8611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=8611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=8611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}