<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'powershell' and 'April Fools'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=powershell,April+Fools&amp;orTags=0</link><description>Search results matching tags 'powershell' and 'April Fools'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Microsoft Delivers Full Suite of SQL Server PowerShell Cmdlets</title><link>http://sqlblog.com/blogs/merrill_aldrich/archive/2012/04/01/microsoft-delivers-full-suite-of-sql-server-powershell-cmdlets.aspx</link><pubDate>Sun, 01 Apr 2012 16:20:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:42621</guid><dc:creator>merrillaldrich</dc:creator><description>&lt;p&gt;We’ve all been waiting several years for this, and finally it’s here! Coinciding (approximately) with the release of SQL Server 2012, a new Feature Pack has appeared on the Microsoft web site that adds a full suite of PowerShell cmdlets for DDL and other functions. This means that, at last, we can do things like fully-featured SQL deployment scripts without all the (severe) limitations of T-SQL, such as primitive use of variables, flow control, exception handling.&lt;/p&gt;  &lt;p&gt;Taking a cue, finally, from the community project SQLPSX, the SQL Server team seems to have designed the new library with ease-of-use in mind, thankfully concealing a lot of the complexity of using raw SMO objects through a language like C# or PowerShell.&lt;/p&gt;  &lt;p&gt;Here’s a teaser showing just a few of these new offerings:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;New-Table –Schema dbo –Name Accounts –Columns $myColumns&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;Remove-Table –Schema dbo –Name Accounts&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;New-Index –Table $myTable –Columns $myIndexedColumns&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;Set-Index –Name dbo.Accounts.idxBar –Columns $myRevisedColumns&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;New-Procedure –Name Foo –ScriptBody $sqlcmd&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The list goes on! This will make deployment of changes to existing databases so much easier. No more insanely complicated T-SQL scripts with brittle Dynamic SQL and hazardous error handling to manage complicated flow control like “Create this object if it doesn’t exist already.”&lt;/p&gt;  &lt;p&gt;And all you admins aren’t left out in the cold either – check out the fresh cmdlets for managing SQL Agent jobs, and the incorporation of Agent into PBM!:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;New-AgentJob –Name MyJob –Type PowerShell –ScriptBody c:\scripts\foo.ps1 –Schedule $MySchedule&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;Set-AgentJobSchedule –Name “Daily at 3:00 am” –StartTime “03:00” –Enable&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;Set-ServerProperty –MaxDop 4 –MaxMem 8000GB&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I am SO excited, and this is amazing, but I haven’t had a lot of time to explore all the options. I hope to really dig in after reading everyone I &lt;i&gt;else’s&lt;/i&gt; April Fool’s posts. Until then, you can download this feature pack yourself (probably) at:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?id=88254"&gt;http://www.microsoft.com/download/en/details.aspx?id=88254&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Edit April 2: Please note if you come back to this page later, this was an April Fool's joke. There are a handful of new cmdlets in SQL Server 2012, but nowhere near this level of support.&lt;/p&gt;</description></item></channel></rss>