Posted on February 27, 2010, 7:18 pm, by Rhys, under
Data,
Powershell.
The London Datastore has loads of datasets available that we can use for free. One of the datasets available is a list of TFL Station Locations. The station location feed is a geo-coded KML feed of most of London Underground, DLR and London Overground stations. Here’s Powershell script that will extract this data from a [...]
Posted on February 21, 2010, 7:51 pm, by Rhys, under
Powershell.
I’m looking at building some Powershell scripts that can accept user input to perform different tasks with a wizard style interface. As it happens this is fairly easily achieved with the Read-Host cmdlet. Here’s a quick script showing how such a powershell script may look.
?View Code POWERSHELLfunction mainMenu()
{
Clear-Host;
Write-Host "============";
Write-Host "= MAINMENU =";
Write-Host "============";
Write-Host "1. Press [...]
Posted on February 9, 2010, 10:24 pm, by Rhys, under
DBA,
Powershell.
Here’s a Powershell script that can be used to manage index fragmentation in SQL Server databases. The strategy I’ve used in the script is based on a recommendation from Pinal Dave (blog | twitter) in his article Difference Between Index Rebuild and Index Reorganize Explained with T-SQL Script. Just set the $sqlserver and $database variables [...]
Posted on February 1, 2010, 11:56 am, by Rhys, under
Powershell.
Here’s a Powershell snippet that randomly sorts the lines in a file. The snippet below reads a text file, called file.txt, located in your user profile directory. The data in the file will be written back with the lines in a different order.
?View Code POWERSHELL$data = New-Object System.Object;
$data = Get-Content "$Env:USERPROFILE\file.txt";
# Random sort the lines [...]
Posted on January 26, 2010, 9:04 pm, by Rhys, under
Powershell.
I really used to like apt-get when I used to run Linux as my home os a few years ago. Once you got the hang of it installing and managing software was easy. I’m obviously pleased to see PsFetch in development. This tool is the Windows Powershell take on apt-get which will allow you to [...]
Posted on January 25, 2010, 8:51 pm, by Rhys, under
Powershell.
I’m really into Powershell so I like trying out all the available tools. Somehow I’ve missed the release of the PowershellShellPack which has ten modules offering all kinds of additional functionality including file handling, operating system information, GUI and code generation. I followed the Channel 9 video and ran into a problem on the first [...]
Posted on January 16, 2010, 4:50 pm, by Rhys, under
Powershell.
One of the great things about Powershell is its ability to take advantage of the .Net platform. If Powershell can’t do it you bet there’s a .Net library that can. Not only is this great for extending your scripts but I also like to use Powershell to test some of my classes. Rather than fire [...]
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 by Quest [...]
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 [...]