{"id":5821,"date":"2008-06-22T22:58:00","date_gmt":"2008-06-22T22:58:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2008\/06\/22\/sql-use-of-minishells\/"},"modified":"2019-02-18T13:13:09","modified_gmt":"2019-02-18T20:13:09","slug":"sql-use-of-minishells","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/sql-use-of-minishells\/","title":{"rendered":"SQL Use of MiniShells"},"content":{"rendered":"<p><span>The SQL team has been receiving a lot of bashing lately over some of the decisions they made integrating PowerShell into SQL 2008.&nbsp; I thought I would take a couple minutes to clarify a few things, eat some sin and talk about a constructive engagement model between the community and the feature teams implementing PowerShell cmdlets.<\/span><\/p>\n<p><span>First let me declare my long standing admiration for the SQL team.&nbsp; Those superstars have consistently been one of the teams that really GOT what it meant to release software for production environments.&nbsp; They have a great quality culture and process and they have top-shelf leadership that reinforces this across the board.&nbsp;&nbsp;SQL has been the&nbsp;gold standard&nbsp;of great scripting because their GUIs produce scripts that you could harvest for reuse (yes it wasn&#8217;t full coverage but they GOT IT years before anyone else).&nbsp; They are a great team &#8211; full stop.<\/span><\/p>\n<p><span>The majority of the&nbsp;heartburn has come from SQL&#8217;s use of MiniShells.&nbsp; A MiniShell is a non-extensible version of PowerShell with a set of baked in Cmdlets and providers.&nbsp; Some of my best community friends have pointed to SQL&#8217;s use of MiniShells as evidence that they &#8220;don&#8217;t get it&#8221;.&nbsp; This is not correct.&nbsp; I told the SQL team about MiniShells and recommended that they use them because I thought they were a good fit for the sort of production-oriented value proposition they provide their customers.&nbsp; So&nbsp;direct&nbsp;your criticisms at me on this one.<\/span><\/p>\n<p><span>First let&#8217;s talk about MiniShells and why they exist.&nbsp; During the Vista reset, there was a great deal of anxiety about .NET versioning and general angst about instability arising from&nbsp;plugin models where code coming from the various sources run in the same process.&nbsp; Imagine the case where you load plugins from 10 different sources and then something goes wrong &#8211; who is responsible?&nbsp; Who do you call for support?&nbsp; MiniShells allow teams to address these issues by creating fixed execution environments that built in our labs and fully tested\/verified before release.&nbsp; If you have a problem with a SQL PowerShell and call PSS, the first thing they are going to do is to have you try to reproduce the problem using the SQL MiniShell.&nbsp; <span>&nbsp;<\/span>(NOTE:<span>&nbsp; <\/span>In my experience, 9 out of 10 times that you have a problem with multiple plugins in a process comes from bad memory management <span>&nbsp;<\/span>&#8211; a problem largely [but not completely] managed out of existence by the CLR.)<\/span><\/p>\n<p><span>The problem is not that SQL shipped a MiniShell but rather that there are SQL UX scenarios that use the MiniShell instead of a general purpose PowerShell.&nbsp; The SQL Management Studio GUI has context menus which launch their MiniShell.&nbsp; This is where we made a mistake.&nbsp; By definition, this is an escape out to an environment to explore and\/or perform ad hoc operations.&nbsp; This environment does not benefit from the tight production promises that a MiniShell provides, in fact it is hampered by them.&nbsp; Because the MiniShell is a closed environment, you can&#8217;t even manually add snap-ins.&nbsp; This is what sent people\u2019s meters into the red &#8211; and understandably so.&nbsp; <\/span><\/p>\n<p><span>Sadly it is too late to make this change for SQL 2008 but the SQL team will change this at their next opportunity.&nbsp; In the meantime, when you are at the MiniShell prompt, you can just launch regular PowerShell with a console file that contains whatever snapins you want to use (including the SQL snapins &#8211; they can be added to a PowerShell session).<span>&nbsp; <\/span>Clearly this is less than optimal but it is not onerous either.&nbsp; We are working with the SQL team on the PowerShel V2&nbsp;designs to make sure that we can offer teams like SQL the safety\/production quality&nbsp;they need while providing the customers the flexibility they want.<\/span><\/p>\n<p><span>&nbsp;<\/span><\/p>\n<p><span>Let&#8217;s take a minute and talk about the engagement model.&nbsp; I&#8217;ve encouraged the community to complain loudly when we screw up and aren&#8217;t giving you want you want\/need.&nbsp; No one benefits by you suffering in silence.&nbsp; In that regard, I can say that the MiniShell firestorm has been a big success.&nbsp; That said, for complaints to be actionable, they need to arrive in time to be acted upon.&nbsp; I&#8217;m sure that someone can point to a blog or email somewhere that pointed this out a long time ago but the reality is that it didn&#8217;t pop as a problem until recently and now it is going to have to wait until the next cycle to get fixed.&nbsp; The good news is that the community feedback mechanism works, we just need to improve the timing.<\/span><\/p>\n<p><span>One last note about tone.&nbsp; I&#8217;ve often joked that complaints were critical and politeness was desirable but optional (in other words, I&#8217;d rather get a rude complaint than polite silence).&nbsp; Let me take a moment to tweak that guidance a little.&nbsp; PowerShell is our passion and our day jobs and we&#8217;ll endure almost anything to get the information we need to make this the best product ever.&nbsp; So that engagement model is totally applicable to the PowerShell team.&nbsp; That said, PowerShell is not the feature teams day jobs.&nbsp; In the case of the SQL team, it was a stretch goal pursued because of the passion of a small set of individuals (Michiel Wories in particular).&nbsp; The bottom line is that it is still critical to complain but when you complain about the feature team&#8217;s support of PowerShell, just double check the tone and try make it constructive.&nbsp; Above all, let them know that you appreciate their efforts (just don\u2019t get so wrapped up that you forget to include the complaint <\/span><span><span>J<\/span><\/span><span>)<\/span><\/p>\n<p><span>Cheers!<\/span><\/p>\n<p><span>Jeffrey Snover [MSFT]<br \/>Windows Management Partner Architect<br \/>Visit the Windows PowerShell Team blog at:&nbsp;&nbsp;&nbsp; <a href=\"http:\/\/blogs.msdn.com\/PowerShell\"><font color=\"#0000ff\">http:\/\/blogs.msdn.com\/PowerShell<\/font><\/a><br \/>Visit the Windows PowerShell ScriptCenter at:&nbsp; <a href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx\"><font color=\"#0000ff\">http:\/\/www.microsoft.com\/technet\/scriptcenter\/hubs\/msh.mspx<\/font><\/a><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The SQL team has been receiving a lot of bashing lately over some of the decisions they made integrating PowerShell into SQL 2008.&nbsp; I thought I would take a couple minutes to clarify a few things, eat some sin and talk about a constructive engagement model between the community and the feature teams implementing PowerShell [&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":[318],"class_list":["post-5821","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-sql"],"acf":[],"blog_post_summary":"<p>The SQL team has been receiving a lot of bashing lately over some of the decisions they made integrating PowerShell into SQL 2008.&nbsp; I thought I would take a couple minutes to clarify a few things, eat some sin and talk about a constructive engagement model between the community and the feature teams implementing PowerShell [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/5821","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=5821"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/5821\/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=5821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=5821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=5821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}