Working with INI style files in PowerShell


Anyways, about year ago I was working on moving some parts of our deployment scripts to PowerShell. One of the things that was on the to-do list was parsing and building hashes out of .ini style files. It was not uncommon to find these files used for persisting configuration information and also for automation so, I assumed we would have a built-in cmdlet to cover this kind of a file. We do not have it.

It is a little disappointing but, since the structure of the file is almost static; we can code very easily around it.

Tagged with: , , , ,
Posted in Fun-Stuff, PowerShell

T-SQL Tuesday #38 – Standing Firm


I am going to be writing about resolution.

To me the word means, ‘firmness of purpose’. That dogged resolve to see through an issue to the end is something I miss dearly but, I would like to make a very conscious effort towards giving the best I can when working on something.

Being proactive and industrialization of existing solutions are some of the goals I set this year.

Tagged with: ,
Posted in general

Adding Extended Properties to SQL*Server Databases Using PowerShell


When you are working as part of a team that manages a few hundred SQL*Server instances; sometimes, it becomes hard to keep track of all the people who need to be notified when you plan for database migrations and such. Also, if there is an issue that needs their input ($’s); we do not want to send it to the wrong person now, would we. Maintaining the information in excel sheets is good but, wouldn’t it be nice to have the information available on the DB itself? We can get all the information in one shot and send out e-mails to the concerned (correct) individuals.

Tagged with: , , , ,
Posted in PowerShell, SQL Server

2012 in review


The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog. Here’s an excerpt: The new Boeing 787 Dreamliner can carry about 250 passengers. This blog was viewed about 1,800 times in 2012. If it were a Dreamliner,

Tagged with: , , ,
Posted in Fun-Stuff

Creating a logging framework in PowerShell – The Final Part


In the final part we will see how to use the new module that we created in scripts.

Tagged with: , , , ,
Posted in PowerShell

Windows Powershell for Developers by Douglas Finke; Published by O’Reilly Media


PowerShell as a scripting environment has enamoured the IT-Pros but, we do not see the same level of enthusiasm from the developers. This could be because there are few good resources they can turn to. This book, bridges that gap by taking a practical approach to development with the shell.

Tagged with: , , ,
Posted in general, PowerShell

Creating a logging framework in PowerShell – Part 4


In Part-1, we looked at why logging was important, established a set of guidelines or targets that we need to keep in mind while designing the framework and defined few variables that we will be using.
In Part-2, we expanded on the basics created a few more variables and created a function ‘Write-Log’, which as the name suggests writes messages to the log file.
InPart-3, we saw how we can manage the multiple log files that get generated using ‘Switch-LogFile’ function.
In this part we will tie everything up and put all the code into a neat little script module that we can use. But, before we do that we need a way to service more than one script in a given session.

Tagged with: , , , ,
Posted in PowerShell

Creating a logging framework in PowerShell – Part 3


In Part-1, we looked at why logging was important, established a set of guidelines or targets that we need to keep in mind while designing the framework and defined few variables that we will be using.

In Part-2, we expanded on the basics created a few more variables and created a function ‘Write-Log’, which as the name suggests writes messages to the log file.

In this part we will look at managing the logs that we will generate.

Tagged with: , , , ,
Posted in PowerShell

Creating a logging framework in PowerShell – Part 2


In the first part; we looked a little bit at why logging was important, established a rudimentary of set guidelines to help us log the script actions and also started taking first steps in our journey to creating a logging framework. So, onwards we move.

Tagged with: , , , ,
Posted in PowerShell

Creating a logging framework in PowerShell – Part 1


Logging is a very crucial technique and is a great tool for investigating and analysing problems. How much logging you want to do depends on the kind of scripts you write. Exploratory scripting might not require you log everything but, during script development it is going to be useful to have knowledge of what your script is doing and it would be good to know what the hell is wrong is that one particular function that you can’t seem to quite figure out. When you are putting out a production script it may become mandatory to log what the script is doing or at the very least log what actions the script is performing.

Tagged with: , , , ,
Posted in PowerShell
Design a site like this with WordPress.com
Get started