The PowerShell Conference Book – My Chapter


Welcome to the 291st post on tommymaynard.com. It’s countdown to 300!


Well, it’s happened. My chapter has gone live in The PowerShell Conference Book. This is one of those moments I’ll never forget. Even so, it may not be entirely for the reason you might think. Sure, I’ve got my name alongside some of the biggest names in the PowerShell community right now, and that’s amazing, but this isn’t about me, so much. You see, the money collected from this effort goes toward The DevOps Collective, Inc. OnRamp Scholarship. That’s what’s most rewarding. It’s bigger than me, and as such, I’m glad that those of us that were chosen and accepted the opportunity to write a chapter, have been able to help in these fundraising efforts. I think it’s apparent that those already published certainly have.

(Read more below)

Before you rush over to Leanpub and get your own copy, let’s quickly discuss my chapter. Sure, there will eventually be 30 some chapters to consider, and just maybe you’ll read them all. If not, then at least give me the chance to see if I can get mine, on your must read list.

What I did was take some old code, and thanks to this project, greatly improve it. The chapter is called “The Profile Script: All Things All Places,” and it has everything to do with syncing a PowerShell profile script between multiple computers. You make a change to your CurrentUserAllHosts profile script on one of the computers in your sync group (a group of computers that all use the same profile script), and it ends up on the other computers in your sync group. It has some cool fixture code that uses PowerShell to create PowerShell. Its purpose, is to create your new CurrentUserAllHosts profile.ps1 profile script for all the computers in your sync group. Don’t worry, it’ll back up that profile script if it already exists. That fixture code function, might just be one my favorite parts of all the code written for this project.

When this step is done, you can add a partner, such as Dropbox, in order to start the sync process. Reopen PowerShell, and your profile script is copied from the system to Dropbox, in my example. Head over to another computer and run another function to establish the sync there. Now, everything should be synced between the two computers. It’s pretty new code, so expect that there might be problems. It’s open source, so we can both be sure to add features, and fixes over on GitHub. It’s great to know that any new variable, or alias, or function, added to my profile script on any of my computers, will be available on all the others, if I want it on all the others. There’s a way to make that determination inside the SinkProfile’s profile script.

Don’t let the below photo fool you; that’s not all the private functions. You’ll have to read the chapter to find out what’s missing. At some point in the development process, I stopped using the dry erase board, although it did feel mandatory early on. I added two final private functions (the ones in red), to the code, but they didn’t make this list. I see something else wrong, but oh well, this portion of my endeavor is complete.

Thank you for your time, and enjoy the book. There’s some extremely talented authors in this publication, and I’m honored to have been included with this group of PowerShell community members. I’m also excited that I was able to potentially add to the OnRamp Scholarship.

Leave a Reply

Your email address will not be published. Required fields are marked *