Posted on January 15, 2010, 7:10 pm, by Rhys, under
Powershell.
I love Powershell. You can do some really cool things with just a few lines of code that you would struggle to do any other way. There’s quite a community around Powershelll providing a fair number of tools. Here’s a round-up of a few I have used. PowerGUI – http://powergui.org PowerGUI is a project supported [...]
Posted on December 28, 2009, 3:26 pm, by Rhys, under
Powershell.
Chuck Boyce Jr (blog | twitter) recently commented on a limitation of the script from my post Discover SQL Servers with Powershell. The script does require that the SQLBrowser service is running for discovery to occur which may be a major issue for some. Here’s an alternative method that does not have this limitation. All [...]
Posted on December 26, 2009, 6:59 pm, by Rhys, under
Powershell,
SSIS.
SSIS and Powershell are two of my current loves in technology, so of course, I was excited to see someone has made a Powershell Script Task. I’ve been meaning to try this out for months. Unfortunately it looks like the project isn’t currently active, but I thought I’d still give it a whirl, and post [...]
Posted on December 18, 2009, 4:03 pm, by Rhys, under
Powershell.
Ashamed of the amount of time you spend on Twitter? Want to know how to automate Internet Explorer with Powershell? Once again Powershell comes to the rescue! Here’s an illustration I came up with to post tweets on your twitter account from a text file. Create a text file called tweets.txt and place it into [...]
Posted on October 28, 2009, 9:34 pm, by Rhys, under
Powershell.
Powershell is a pretty cool tool for many things including working with data. It’s just such a great time saver if you have to deal with multiple files or need to change them into different formats. Here’s how easy it is to turn a csv file into well-formed xml. ?View Code POWERSHELL# csv file to [...]
Posted on October 1, 2009, 8:14 pm, by Rhys, under
Powershell.
A few days ago I was working with a client that was providing an export of data from Oracle. The file being produced was choking my SSIS package due to various formatting issues. After working with the client and getting a file that looked good to the naked eye I discovered that a large amount [...]
Posted on September 23, 2009, 10:59 pm, by Rhys, under
Powershell.
I’ve blogged before about the usefulness of Powershell for data tasks. A few weeks ago I had a requirement at work for merging csv files and recently I needed to split a single csv file into several files. While this is easy to do using SSIS and a bit of T-SQL it is a little [...]
Posted on September 15, 2009, 9:14 pm, by Rhys, under
Powershell.
Progress bars can be a nice visual indicator as to how a far a task is into its workload. Windows Powershell provides us with the ability to create these within the console fairly easily. This simple code will demonstrate the basics of the Write-Progress cmdlet, which allows us to deploy progress bars in our scripts. [...]
Posted on September 5, 2009, 5:21 pm, by Rhys, under
Powershell.
With Powershell and SMO you can easily discover SQL Server instances running on your network in just a few lines of code. ?View Code POWERSHELL[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null; $smoObj = [Microsoft.SqlServer.Management.Smo.SmoApplication]; # This gets the sql servers available $sql = $smoObj::EnumAvailableSqlServers($false) foreach($sqlserver in $sql) { Write-Host -ForegroundColor Green "Discovered sql server: " $sqlserver.Name; } [...]
Posted on August 24, 2009, 12:24 pm, by Rhys, under
Powershell.
Powershell is really useful for documenting and managing your servers but it’s also a pretty good tool for working with data. I’ve been using it to merge csv files, with an identical structure, into a single file. Now this is pretty easy, if rather tedious, to do using SQL Server Import / Export functionality or [...]