PowerShell for Developers

PowerShell for Developers
David Wilson
Announcements

Join us for the PowerShell Editor Services Hack Week, Dec 6-13!

Do you wish your favorite editor had better PowerShell editing support? Do you have a great idea for a new feature for the PowerShell extension in Visual Studio Code? We’re dedicating next week, December 6th through 13th (Sunday through next Sunday), to hacking together on new features to enable better PowerShell support in any editor! Here’s the plan: On Sunday, December 6th at 11AM-12PM PST (7-8PM GMT) I’ll host a Crowdcast event to give an overview of PowerShell Editor Services, the PowerShell extension for VS Code, and other general ideas for contributions that people can make.

Carlo Mancini
PowerShell for Developers

The JAPE challenge

I have wanted to write my very own obfuscated e-mail signature for a long time but kept myself from doing it. At the time I thought of all these lines of obfuscated code that people wrote during competitions such as the International Obfuscated C Code Contest (IOCCC) or the Obfuscated Perl Contest as beyond interest. Then I started competing in the Scripting Games, and some tasks involved writing Powershell oneliners that required mastering the use of the pipeline as a tool to refine what each cmdlet passed to another.

nohwnd
PowerShell for Admins

Command and query separation in Pester tests

Do you feel that writing tests is confusing, and you often end up with complicated test code? I did too, before I learned about Command-query separation principle (or CQS). This principle lead me to start thinking about data flow directions in tests and in the end I realized there are few basic patterns that I use in my test code over and over. Command-query separation principle The command and query separation principle tells us that we should separate commands from queries (duh!

pscookiemonster
PowerShell for Admins

Writing and Publishing PowerShell Modules

Earlier in August we mentioned that modularity and abstraction are quite helpful. PowerShell modules can help enable these concepts. You might ask “Modules… why can’t I just write a function?” There are a number of benefits to bundling your functions into modules: Simplify code organization Group related functions together Share state between functions, but not with the user Re-use “helper functions” that you don’t want exposed to the user Improve discoverability: Find-Module MyModuleGet-Command -Module MyModule * Simplify distribution: Install-Module MyModule `Where does that last bullet come from?

Adam Platt
PowerShell for Developers

Use Import-LocalizedData to Internationalize your Scripts

Whether you’re working with an enterprise client with a global presence or building a tool that you want to share with the world, you may find yourself wanting to build support for multiple languages into your scripts. The Import-LocalizedData Cmdlet is a simple and powerful way to achieve this. I put up a pair of posts about my recent experience with a globalization effort and how we were able to get a lot of functionality with only a few lines of code.

pscookiemonster
PowerShell for Admins

Continuous Integration, Continuous Delivery, and PSDeploy

Are you starting to use version control at work? Are you being pestered by fellow PowerShell aficionados to start learning version control? Did you catch the PowerShell.org Crash Course in Version Control and pick up some Git and GitHub experience? Shameless plug, sorry : ) Version control is just the start. What if we want to automate testing? To deploy our files, folders, and other artifacts out to production or other environments?

Joel Newton
PowerShell for Admins

New PS Module for working with F5's LTM REST API

If you use F5’s BIG‑IP Local Traffic Manager (LTM) for load-balancing, then you may find the new PS module I’ve written helpful. The module uses the REST API in ver. 11.6 of the LTM to query and manipulate an F5 LTM device. You can add and remove members from a pool, enable and disable them, and find out what pools a member is in, among other things. I’ve made the module files available here.

pscookiemonster
PowerShell for Admins

Survey: Source Control for the IT Professional [Results in]

Edit: The results are in. I was watching Don and Jeffrey’s PowerShell Unplugged session from Ignite the other day, and something stood out. At 30 minutes in, Don asked the crowd whether they were using source control. Based on the video, the crowd wasn’t big on source control. I work in IT. If I asked that same question at work, I would likely get a similar response. Why is that? Source control is incredibly important and can drive a number of other processes, yet it seems to be an afterthought for many IT professionals.

Don Jones
PowerShell for Admins

PowerShell v5: Class Support

This post is based on the September 2014 preview release of WMF 5.0. This is pre-release software, so this information may change. One of the banner new features in PowerShell v5 is support for real live .NET Framework class creation in Windows PowerShell. The WMF 5.0 download’s release notes has some good examples of what classes look like, but I wanted to briefly set some expectations for the feature, based on my own early experiences.