Posts

Showing posts with the label DevOps

Creating a DSC module to install Oracle Client and disable enable UAC

You ever get a task and think, how hard can this be? Then you begin down what turns into a seemingly never ending journey. Welcome to mixing old and new technologies. I found myself in the position of needing to install the Oracle Client on a Windows VM running in Azure using Desired State Configuration (a.k.a. DSC) and, well, let's just say it was an interesting journey. Listed directly after this is the snippet of the DSC which I'm posting here in hopes that others who have a similar need may stumble across this and save themselves from headache. I'll provide a break down of the major pieces. I have intentionally left the logging pieces in the script so that any who would be so bold as to cut and paste without reading over at least have a log to dig into. A few important prerequisites to using this script. You'll need a DSC module that downloads the Oracle Client Package, the one I used was for 11gR2 and includes an answer file for the client. These ite...

Resilient Scripting is scripting that can be rerun... safely

Image
Making a script that is resilient can mean many different things to different people, IMHO an important one is to be able to re-run a script "safely". By safely I mean to minimize side effects and to prevent negative consequences. To illustrate let's say we have an install process and we need to log details about what happens when we run the install. To keep this simple let's just focus on the logging requirement. We want a log file that we can look at when an install happens. So a simple approach would be as follows. Set-Content log.txt "Information about Install" Nice and simple, we have satisfied the requirement. But let's see if we can make this one liner more resilient. $logFileTime = Get-Date yyMMddhhmmss $logFileName = $logFileTime + "_log.txt" Set-Content $logFileName "Information About Install" Now even if we run this install multiple times we will have a script for each instance of the install even when ...