This is part of my Powershell Challenge, to learn more about PowerShell (PoSh) using the Learn Windows Powershell 3 in a Month of Lunches book by Don Jones.
Author: way0utwest
-
Powershell in a Month Day 17 – Security Alert
Security. It’s important, and I was thinking this chapter would show us more about changing security. Instead, this chapter is really an outline and discussion of what security method are built into the PoSh shell. The chapter first emphasizes that the PoSh environment doesn’t bestow and special rights or abilities to the executor. The commands just execute, or fail to execute, base do on the rights you have in windows already. I can see that as some of the commands I run at times fail when I haven’t run the shell as an administrator.From there the chapter talks about the different execution policies, which I haven’t thought much about. I end up typically changing the execution policy on each VM initially so I can run scripts to Unrestricted. I know that isn’t recommended, but I typically need things to just work.I also hadn’t realized that I could set this in a GUI in Windows. That’s good to know, and I suspect, it’s another example of where Windows is implementing PoSh commands under the hood of the GUI. It would be nice to see a Trace for PoSh to watch commands come through GUI actions.The chapter finisheds by talking about the digital signing of scripts, how it works, and what you need to do. I haven’t messed with this and it’s not a part of the lab, but it’s something I’d probably do in a large organization, or even any organzation to be sure that hte code that’s being automated and run is actually the code that has been tested.Overall, a short chapter. Slightly informative, and definitely an easy day. -
VMs for Development
Here’s the scenario: you have gotten a few consulting jobs and have a couple clients. This could be your full time employment, or a side job that you perform away from another employer. You want to watch your budget, ensure you can work efficiently, and handle whatever requirements your clients may send your way. This week’s question is:
How do you set up your virtual environment at home?
I think the idea of using Virtual Machines (VM) is a given these days, but do you have one VM with all your tools in it? Do you use separate VMs for each client? What about licensing? Those can be complex questions for many people, especially if your employer does not provide you with multiple license keys.
I hope that you are using VMs as having multiple computers isn’t practical these days, especially as the cost of power rises. A relatively small, inexpensive desktop computer can run 5, or even 10, VMs to simulate a variety of environments. I’ve seen some creative uses of hypervisors and other software to simulate clusters, SANs, and even multiple domains on one host.
Let us know this week if you have some good tricks that can help someone get started with virtual machines, building a lab, choosing hardware, or easily configuring networking for their own learning efforts. Tell us what software you use, and if you don’t mind sharing cost data, I’m sure others would appreciate the information.
Steve Jones
The Voice of the DBA Podcast
Listen to the MP3 Audio ( 1.9MB) podcast or subscribe to the feed at iTunes and Mevio .

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.
-
Building a Virtual Lab with Hyper-V
I needed to get this one on Hyper-V, so I decided to document the process. I’ve put together a series that looks at the steps I took.
- Virtual Lab – Design and Setup
- Differencing Disks
- Setting up a new VM
- Adapter Setup
- The Domain
- New Domain User
- SQL Server
This will fill in as I go through the process, so if there’s something you don’t see, it’s coming.
-
What is Continuous Integration for Databases?
I have a talk that I give on Automated Build and Test for databases. This was put together by one of the engineers at Red Gate Software, and I’ve presented it at a number of events. I enjoy it, and it’s one of those presentations that really gets people thinking. I enjoy getting people to think about software, and there are always good questions that come out of the session.
The talk is essentially about how to set up continuous integration for databases. Continuous Integration is an extension of the daily build, which companies have been using for years to try and ensure some discipline in their software development practices. They want to limit the amount of code that can potentially break software. The whole idea is to test changes developers commit to version control as quickly as possible and give feedback developers immediately so developers can fix issues while the issue is fresh in their minds.
For databases, this can be a challenge. We have this stuff called data that has to be maintained between, during, and after builds. We can’t drop our structures and reload them as a developer does with an executable or DLL. As we work in a CI environment, we need to handle new objects, as well as alterations to existing structures. That means our scripts and code need to handle creation as well as upgrade scripts.
This means that a CI process for databases must not only check out the DDL code from a Version Control System (VCS), but it must also handle the CREATE or ALTER code based on the state of the database. You can always build a database from scratch in your CI process, or you can restore a known version (usually the last version) and apply upgrade scripts. The way this happens depends on how you version your DDL code in a VCS and how your build process is structured.
At Red Gate, we’ve built a number of scripts to help with this process for various CI servers. We have articles that discuss CI for Team City, Jenkins, Bamboo, and probably more by the time this piece appears. We’ve learned a lot about CI over the last few years and we are trying to share both our knowledge and code with you, as well as incorporate those ideas into our products.
Whether you use our products or not, we do believe that you will build better software if you implement CI. We just know that we can make the process a lot smoother with our tools for developers and DBAs.
Steve Jones
The Voice of the DBA Podcast
Listen to the MP3 Audio ( MB) podcast or subscribe to the feed at iTunes and Mevio .

The Voice of the DBA podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.