Category: Blog

  • Powershell in a Month – Day 7 Adding Commands

    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.

    Post holidays, day 7 looks at the shell itself and adding in snap-ins and modules. I have to say that the first time I looked at Powershell was in SQL Server 2008 when there was a “mini-shell”, but I didn’t understand what the difference was. I’m sure I’ve read other explanations, but they didn’t make as much sense. Perhaps because I’m more focused this time on learning PoSh it made sense? Not sure.

    In any case. This chapter starts to explain, and emphasize, there is really only one shell for PoSh. This is in contrast to the earlier SQL implementation, but moving forward, everything will be in one shell. The various shortcuts you find for different Microsoft tools and features are the same shell with an “Import-Module” parameter passed in. This is the same way in which the MMC works, and it’s the same way that we often configure other tools, like SSMS and VS, which have add-ins.

    That’s interesting, and good to know. This means I can not only customize my PoSh environment, but I can set up custom environments that can be shared on all computers in an organization or group. That is one of the main concerns I’ve had with PoSh. If I change my environment on my laptop to do things, I need to be sure all the places I’ll deploy the scripts to have the same environment.

    The chapter also look at snap-ins and modules, which are different. In my earlier work with PoSh, the idea of snap-ins seemed to be a pain, almost like installing Perl on every machine. Snap-ins need to be pre-installed and registered on the computer to be added in. The examples in the chapter load the SQL Server snap-ins, though the chapter mentions that snap-ins are not the way forward. Modules are.

    Modules are more like self-contained items that do not need to be installed. They just need to be in the PoSh path (environmental variable) or loaded with the full disk path. If the modules exist in the PoSh environmental variable, then they are auto loaded.

    The rest of the chapter is really devoted to some practice with modules and loading them. There are brief sections that look at how you can pre-configure your own environment automatically with a configuration file that allows you to pre-load modules or specify settings. That can be handy, especially as you add a series of modules to your setup. That also seems like something that you might want to deploy to all servers, or all members of a team, in order to ensure that any scripts you have written will run.

  • The Powershell Challenge–Notes and Observations

    It’s been a month and a half in real time since I started the Powershell Challenge. In that time, I had a business trip and 9 days of vacation and the holidays that impacted the event. After a week of working on the book, I ended up sporadically getting back to it, partially as I lost the book for 2 weeks after vacation.

    I’m still working my way through it, and as my schedule stabilizes, I’ll get back to regular posts. However, I wanted to make some notes on the issues I’ve seen and the challenges of professional development (PD) from my own experience in the last month.

    Vacation is vacation

    For me, vacation is really vacation. I have tried hard across the last 10 years to learn to enjoy vacation and not work during that time. I rarely check emails, and if I do, I typically don’t respond. I also leave the computer closed most of the time.

    This means, for me, that professional development also gets stunted. There were times in the past where I dedicated some time to professional development while on vacation, but as my kids approach adulthood, and I mature, I have typically stopped doing that.

    You can choose to spend your vacation as you wish, but with time off for family visiting, skiing, and ranch projects, I didn’t do any PD.

    A Schedule Matters

    One of the challenges I face is that I have a hectic life. As a result, when I try to fit things into that schedule, something else gets moved. Across the last month, I’ve been making more of an effort to exercise on a regular schedule, and that’s often been at lunch. Unfortunately, that’s pushed off the Powershell Challenge more days than I’d like to admit.

    I need some routine and schedule, and the holiday season (Thanksgiving-New Years) was disruptive to me. I didn’t think it would be as much of a problem as it was. I thought I could just sit down for 30 minutes and I’d find the time easily.

    I was wrong.

    I need to schedule time to do this each day, and I’m looking to get back to that next week.

    Momentum

    In line with scheduling, I think momentum matters as well. Just as with exercise, if you put it off for a few days, it’s much easier to put it off for a few more days than it is to get back on track and back to work.

    When Thanksgiving intruded, I lost momentum. When I came back and was pressed for time, I put off a few lunches. When exercise became a bigger priority, I put it off even more.

    This is why I do regularly talk about scheduling some time to learn. I think once a month won’t work, though perhaps you can make once a week work. I suspect for me that I need to schedule more regular time, such as every 2-3 days or M-W-F and stick to it. I recognize a balance is important, and I’d likely do this for 4-8 weeks and then take a break for a few weeks before tackling something else.

    I’ll see if I can implement this in the new year.

    A Place

    This might not matter for many of you, but it does for me. I started the Challenge by sitting at the kitchen table with my laptop and the book.

    My desktop for the last year has been a standing desk, that has the keyboard and mouse lifted off the desk surface with boxes. However, there is no place for a book at my desktop. During the holidays, I rarely had my laptop open, and in fact it was often in the bedroom near the bed. Having a book open in bed, or at my standing desk, didn’t work.

    I need to use my laptop regularly with the book and that was an issue for me. I’ll get that back on track next week.

    Summary

    We do need to regularly improve our skills if we work in technology. Or medicine or engineering or law or accounting or a number of fields. Some fields make that easier, but in technology it is mostly up to each of us to motivate ourselves and find time.

    I encourage you to tackle something like my Powershell Challenge, but think about budgeting and scheduling time in order to succeed. I’d also encourage you to schedule in breaks in your life when you aren’t driven to move forward in some direction and just enjoy your life.

  • Slimming down The Voice of the DBA Podcasts

    I announced in the Christmas editorial that I was discontinuing the video podcasts. Needless to say I heard a complaint from my Mom that afternoon. She enjoys the podcasts, even though she doesn’t understand all the technology. I did get a couple other notes from people and thought I should explain things better. I’ll also put an announcement in the Jan 2 newsletter.

    The podcasts have been enjoyable, but also a lot of work. Mostly because they require me to record video, have a location, quiet, etc. to get the recordings done and then there’s editing. If you look at the bloopers, I have quite a few mistakes during the recordings, so there’s no shortage of fix-up to perform in post-production.

    Last year one of the senior management at Red Gate questioned whether it was worth continuing the podcasts. I decided to look at some numbers, ask people, and then decide. I also wanted to get to 1000 of them.

    I hit 1000 last week, and end the year with 1004 podcasts, which is quite a run. It’s been a few years and it feels like I gave it a good chance to grow. However, it didn’t grow much. As I look at the numbers, the MP3 and MP4 (iPod) podcasts have the best numbers for downloads, with WMV not really even mattering. I suspect that the automatic nature of iTunes means that people download them automatically without any issues. As I’ve talked with people, I’ve also realized that most people prefer the written word for this type of information. It’s faster and easier to consume.

    Having met my goal of 1000, and not seeing wide scale adoption, I’ve decided to stop the video podcasts, at least as a regular production. I might do the occasional one.

    The audio (MP3) podcasts as much easier to record and produce, and since I know some people enjoy them, I’ll continue those for the time being. I’ll upload those to the iTunes location and see how that goes.

    What Else Will I Do?

    That’s a good question. I’ve had more speaking engagements in the last couple years, which has definitely impacting the podcasts at times. I missed a few days, which was very annoying to me. I suspect I’ll be doing more speaking and presenting in the next year. I’ve also got no shortage of other projects to tackle.

    One of those is the idea of a radio show instead of a podcast. In technical terms the only difference is that the show will be live most of the time with some interaction with an audience. My initial idea is a weekly show, one that won’t take too much time, but will give me a chance to continue to experiment with how to best reach an audience. I’ve proposed something to my boss, so we’ll see what else happens.

    As for other items, we’ll see what happens as the future progresses.

  • The Effective Cell Phone

    I’ve written a bit about phones recently as I’ve experienced the switch back to iOS from Android. There are a few other posts in this series:

    I wanted to stop and take a moment and think about design of cell phones for a minute. I think that Android, iOS, Windows Phone 8, and other systems have their own strengths and weaknesses. Even though I prefer iOS, I wouldn’t want that to be the only choice for everyone.

    However why should the choice stop there? I think Apple has done a great job with their App Store, and while I don’t like their censorship of applications, I do appreciate their certifying and curating apps. I just wish they’re allow more applications, and more importantly, more defaults.

    What does a smartphone do?

    If I think about what a smartphone, I am looking for it to have these functions:

    • Make and receive phone calls
    • Manage voice mails
    • Manage contacts
    • Handle text messages
    • Browse the web
    • Get email
    • Work with my calendars
    • handle navigation
    • provide keyboard for input
    • provide voice to text services

    I’m sure there are other things. For example, being able to connect with various other platforms (twitter/facebook, etc) from within any application. Maybe I am concerned about text to speech capabilities, or more. When I look back at Android, I appreciated the variety of keyboards that were available. Like most people, I quickly settled on one (Swype), but I did try out the Swiftkey and KeyPal keyboards.

    Why doesn’t that make sense for all of the functions above? Perhaps I want a different dialer that somehow presents data differently, or makes phone calls in a different way. I’m imaging that I might want to route some calls through a service like Skype or Google Voice and some through cellular. I would love the ability to replace the default dialer with some other dialer, just as I could replace keyboards on Swype.

    Many of us have a favorite browser, but it’s not the default on your platform, you may find some links opening in another browser. I should be able to set the core default programs for functions on my platform, as I choose them. I don’t expect that any dialer, or calendar, or other service is allowed. There are core functions that need to be met, and I’d accept that the platform provider, or maybe store, would certify applications as working on the OS, but after that, I ought to be able to replace the default programs that can be run.

    Android is much more open about this than iOS or WP8 in many ways, and I’m not sure if everything above can be replaced. I know I could replace the dialer with Skype instead of cellular, but I’m not sure if all these functions can be replaced. If they can, then kudos to Android.

    I also know that some applications are available for all of these functions, or most of them, but I thought there were places I couldn’t set something as the default. I’m not ready to go back to Android and experiment now, but for sure I wish I had the ability to get automatic, default functionality from the phone in the way I want it.

    Ultimately Apple isn’t making money, or loyalty, on their dialer, or calendar. They make money on the platform, so build the amazing platform, but let other people provide more customizations, as you do now in app stores. Just allow consumers to make those defaults if they choose to.