<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/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 for 'app:weblogs' matching tag 'PoweShell'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=app:weblogs&amp;tag=PoweShell&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag 'PoweShell'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>SQLIse – A PowerShell SQL Server Query Tool</title><link>http://powershell.com/cs/blogs/under-the-stairs/archive/2010/06/04/sqlise-a-powershell-sql-server-query-tool.aspx</link><pubDate>Fri, 04 Jun 2010 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:6759</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;I am doing some work at the moment building SQL PowerShell training for an upcoming &lt;a href="http://www.powershellmasterclass.com" target="_blank"&gt;PowerShell MasterClass&lt;/a&gt;. In my searching, I came across a small project being done by Chad Miller, called SQLIse. As Chad describes in his blog, SQLISE is an ISE add-on that provides&amp;#160; “a&lt;em&gt; basic IDE for T-SQL that includes the ability to exit, execute, parse and format SQL code from within PowerShell ISE”&lt;/em&gt;. &lt;/p&gt;  &lt;p&gt;SQLISE is a part of a larger SQL PowerShell project called SQL Extensions for PowerShell or SQLPSX. Having played a bit with both extensions, they are pretty cool and can certainly help IT Pros who have to deal with SQL. Chad has even created a short video to demostrate SQLISE – get this at YouTube: &lt;a title="http://www.youtube.com/v/1KcNSHn7oTA&amp;amp;hl=en" href="http://www.youtube.com/v/1KcNSHn7oTA&amp;amp;hl=en"&gt;http://www.youtube.com/v/1KcNSHn7oTA&amp;amp;hl=en&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;SQLISE has two pre-requisites. First, you need to have the PowerShell Pack installed and you need the SQLPX extensions loaded. You can get PowerShellPack from the &lt;a href="http://www.youtube.com/v/1KcNSHn7oTA&amp;amp;hl=en" target="_blank"&gt;MSDN Code Gallery&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;One issue I faced was that the SQLIse installation process was not seamless or easy.&amp;#160; In order to get this running, I needed two uber-modules (SQLPSX and PowerShellPack) and these come from different places. Second, the installation process requires you to run programs, SQLPSX_Install and PowerShellPack.MSI. &lt;/p&gt;  &lt;p&gt;I find this somewhat contrary to the spirit of Modules in PowerShell V2 in that modules should be deployable using only Xcopy. In my case, I did not want either uber-module to be loaded in the personal modules folder, but in the system modules folder. But the installer(s) gave me no option. More importantly, while the SQLPSX installation program seemed to run, but left the module folder empty. A bit of hacking (and running streams.exe across the expanded file set!)&amp;#160; enabled me to get the module installed. But sadly the hacking did not work well – and some of the features do&amp;#160; not work. More hacking I suspect is needed.&lt;/p&gt;  &lt;p&gt;In summary, a great feature let down by the complex installation process.&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6da1f4e1-d039-4703-971f-54ef89b010a9" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/PoweShell" rel="tag"&gt;PoweShell&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CodePlex" rel="tag"&gt;CodePlex&lt;/a&gt;,&lt;a href="http://technorati.com/tags/MSDN+Code+Gallery" rel="tag"&gt;MSDN Code Gallery&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SQL" rel="tag"&gt;SQL&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/5384857-8149237028601266807?l=tfl09.blogspot.com" alt="" /&gt;&lt;/div&gt;</description></item><item><title>PowerShellPlus v2.1 Beta</title><link>http://powershell.com/cs/blogs/powershell-scripts/archive/2009/02/04/powershellplus-v2-1-beta.aspx</link><pubDate>Wed, 04 Feb 2009 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:1374</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;This is sort of exciting - &lt;a href="http://powershell.com/cs/blogs/news/archive/2009/02/01/powershellplus-v2-1-beta-is-live.aspx"&gt;PowerShellPlus v2.1 Beta is live!&lt;/a&gt; I’ve used PowerShell Plus for some time and love it. But there are things that I’d like to see, in particular the CTP3 support. Well, now we have that – and I’m downloading it as I write this post. The features in 2.1 that catch my eye are: VBS support, STA MOde, Code Sharing and of course, CTP3 support. I’ll be posting more once I have the code running and have a chance to give it a good test!&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d7790c3d-8698-461a-897c-f5b979bd577a" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Powershell+Plus" rel="tag"&gt;Powershell Plus&lt;/a&gt;,&lt;a href="http://technorati.com/tags/PoweShell" rel="tag"&gt;PoweShell&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CTP3" rel="tag"&gt;CTP3&lt;/a&gt;&lt;/div&gt;  </description></item><item><title>PowerShellPlus v2.1 Beta</title><link>http://powershell.com/cs/blogs/under-the-stairs/archive/2009/02/04/powershellplus-v2-1-beta.aspx</link><pubDate>Wed, 04 Feb 2009 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:1375</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;This is sort of exciting - &lt;a href="http://powershell.com/cs/blogs/news/archive/2009/02/01/powershellplus-v2-1-beta-is-live.aspx"&gt;PowerShellPlus v2.1 Beta is live!&lt;/a&gt; I’ve used PowerShell Plus for some time and love it. But there are things that I’d like to see, in particular the CTP3 support. Well, now we have that – and I’m downloading it as I write this post. The features in 2.1 that catch my eye are: VBS support, STA MOde, Code Sharing and of course, CTP3 support. I’ll be posting more once I have the code running and have a chance to give it a good test!&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d7790c3d-8698-461a-897c-f5b979bd577a" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Powershell+Plus" rel="tag"&gt;Powershell Plus&lt;/a&gt;,&lt;a href="http://technorati.com/tags/PoweShell" rel="tag"&gt;PoweShell&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CTP3" rel="tag"&gt;CTP3&lt;/a&gt;&lt;/div&gt;  </description></item><item><title>Date and Time in PowerShell</title><link>http://powershell.com/cs/blogs/powershell-scripts/archive/2009/01/14/date-and-time-in-powershell.aspx</link><pubDate>Wed, 14 Jan 2009 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:878</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;In &lt;a href="http://pshscripts.blogspot.com/2009/01/get-uptimeps1.html"&gt;yesterday’s PowerShell script of the day&lt;/a&gt; entry,posted over on &lt;a href="http://pshscripts.blogspot.com/"&gt;my PowerShell scripts blog&lt;/a&gt;, I re-implemented an MSDN sample (originally written in VBScript) that calculates up time. The script first used a WMI class (Win32_OperatingSystem) to determine when a computer started. Then the script gets the current time, and works out and displays the difference (i.e. the currentnt uptime).&lt;/p&gt;  &lt;p&gt;The .NET framework contains a class, &lt;a href="http://pshscripts.blogspot.com/2009/01/get-uptimeps1.html"&gt;System.DateTime&lt;/a&gt;, that provides a variety of time/date related features.The PowerShell Cmdlet Get-Date returns a System.DateTime object that contains the current date and time. You can use the methods and properties of the class to get aspects of that current date and time as you need. For example:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#400000"&gt;PSH [D:\foo]: $d=Get-Date         &lt;br /&gt;PSH [D:\foo]: $d.Date &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#400000"&gt;14 January 2009 00:00:00 &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#400000"&gt;PSH [D:\foo]: $d.Year         &lt;br /&gt;2009          &lt;br /&gt;PSH [D:\foo]: $d.IsDaylightSavingTime()          &lt;br /&gt;False&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can, of course, pipe your DateTime object to Get-member to see the other properties and methods on this class (or refer to the MSDN documentation). There’s a lot of pretty rich date and time handling available.&lt;/p&gt;  &lt;p&gt;The problem I had with yesterday’s script is that WMI uses a different format for date and time. The &lt;a href="http://msdn.microsoft.com/en-us/library/aa394102(VS.85).aspx"&gt;Win32_OperatingSystem WMI object&lt;/a&gt; has a property, LastBootUpTime which returns the date and time when the OS was last booted. However, WMI returns this as a string that is formatted rather differently to System.DateTime, as you can see here:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#800000"&gt;PSH [D:\foo]: $os=Get-WmiObject Win32_OperatingSystem         &lt;br /&gt;PSH [D:\foo]: $os.LastBootUpTime          &lt;br /&gt;20090112142457.454125+000&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This demonstrates that .NET, and therefore PowerShell, uses a native date/time formats that are different. For many admins (and for most native level developers) this is not a big deal. But if you need to inter-operate, you have a small issue of converting between the two formats. &lt;/p&gt;  &lt;p&gt;As it turns out, solving this issue is simple. The developers of .NET created a simple solution. First, there’s a .NET class,&amp;#160; System.Management.ManagementDateTimeConverter, which does date and time conversion. This class has a method, ToDateTime which converts a WMI date string into a .NET DateTime object. I used this&amp;#160; method in the WMIDateStringToDate function in Get-Uptime.ps1.&lt;/p&gt;  &lt;p&gt;You can either implement a function (i.e. WmiDateStringToDate) in your profile or cut/pasted it into any WMI script you write. Naturally, you could just use the .NET method natively. As follows:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#800000"&gt;PSH [D:\foo]: $os=get-wmiobject win32_operatingsystem         &lt;br /&gt;PSH [D:\foo]: $time = $os.lastbootuptime          &lt;br /&gt;PSH [D:\foo]: [System.Management.ManagementDateTimeconverter]::ToDateTime($time) &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#800000"&gt;12 January 2009 14:24:58 &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New" color="#800000"&gt;PSH [D:\foo]: ([System.Management.ManagementDateTimeconverter]::ToDateTime($time)).hour         &lt;br /&gt;14&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As with most things PowerShell, easy stuff is very easy while complex stuff is often just a method call away.&lt;/p&gt;  &lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:26a673af-e1cf-4606-8ab8-9b52826c5597" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/WMI" rel="tag"&gt;WMI&lt;/a&gt;, &lt;a href="http://technorati.com/tags/PoweShell" rel="tag"&gt;PoweShell&lt;/a&gt;, &lt;a href="http://technorati.com/tags/System.Management.DateTimeConverter." rel="tag"&gt;System.Management.DateTimeConverter.&lt;/a&gt;&lt;/div&gt;  </description></item></channel></rss>