PowerShell for Developers

PowerShell for Developers
pscookiemonster
PowerShell for Admins

PowerHour: Community Lightning Demos!

One of my favorite events at the PowerShell + DevOps Global Summit is the community lightning demos. It’s a fun format: For the audience: Fast paced (max 10 minutes) Many speakers Topic or speaker not what you’re looking for? They’ll change in a few minutes Demos offer enough material to give you ideas and point out where to learn more Content is more likely to have a high signal-to-noise ratio given the time constraints For the speakers:

msorens
PowerShell for Admins

Do Anything in One Line of PowerShell

PowerShell provides a tremendous boon to productivity for computer professionals of all types. But, you have to admit: it can be a bit daunting to get up to speed! Indeed, as someone who has a fair amount of experience using it, I still find myself having to look up how to do things–frequently. So I started keeping track of the recipes I was using the most. And came up with a list of 400 or so, published in 4 parts.

Don Jones
PowerShell for Admins

UPDATE / Tug: The Open-Source DSC Pull Server

If you haven’t taken a look at Tug, now’s a great time. Eugene Bekker has been doing a ton of heavy lifting, taking my .NET Core proof-of-concept code and turning it into a formal ASP.NET MVC project.

msorens
PowerShell for Admins

PowerShell Gotchas

You can certainly find a number of articles around that present PowerShell pitfalls that can easily trip you up if you are not careful. I took a different approach in my three-part series, A Plethora of PowerShell Pitfalls. The first two parts are presented in quiz format, together covering the top 10 “gotchas”. They will help you test your awareness to see if you even realized the danger and did not know you’ve been skirting those traps for awhile.

msorens
PowerShell for Admins

Pitfalls of the Pipeline

Pipelining is an important concept in PowerShell. Though the idea did not originate with PowerShell (you can find it used decades earlier in Unix, for example), PowerShell does provide the unique advantage of being able to pipeline not just text, but first-class .NET objects. Pipelining has several advantages: It helps to conserve memory resources. Say you want to modify text in a huge file. Without a pipeline you might read the huge file into memory, modify the appropriate lines, and write the file back out to disk.

msorens
PowerShell for Admins

Create Custom Monitors with PowerShell

Sometimes, as a developer, you want to be be able to keep track of free space on a drive, the size of a log, the load on your CPU, the number of users logged in, etc. With PowerShell, it is typically just a matter of finding the right cmdlet amidst the large (and rapidly growing) pool of cmdlets provided by Microsoft and by third parties. Then you just run Get-Foo to check details about the foo resource.

Richard Siddaway
Announcements

PowerShell is Open Sourced

For those of you that have been at PowerShell Summits over the last few years you’ll have heard Jeffrey Snover state that he wanted to take PowerShell to other platforms. Now its happened Jeffrey has announced that an ALPHA release of PowerShell is now available for Linux and Mac. Currently available for Ubuntu, Centos, Red Hat and Mac OS X with more to come The announcement is at https://azure.microsoft.com/en-us/blog/powershell-is-open-sourced-and-is-available-on-linux/ Also see PowerShell blog

msorens
PowerShell for Admins

Every pithy witticism begins with quotation marks

“To be or not to be”. Without getting into a debate over whether Shakespeare was musing about being a logician, suffice to say that in writing prose, the rules of when and how to use quotation marks are relatively clear. In PowerShell, not so much. Sure, there is an about_Quoting_Rules documentation page, and that is a good place to start, but that barely covers half the topic. It assumes you need quotes and then helps you appreciate some of the factors to consider when choosing single quotes or double quotes.

Don Jones
PowerShell for Developers

High-Level: Designing Your PowerShell Command Set

So you’ve decided to write a bunch of commands to help automate the administration of ____. Awesome! Let’s try and make sure you get off on the right path, with this high-level overview of command design. Start with an inventory You’ll need to start by deciding _what commands to write, _and an inventory is often the best way to begin. Start by inventorying your nouns. For example, suppose you’re writing a command set for some internal order-management system.

msorens
PowerShell for Admins

Complete Guide to PowerShell Punctuation

Quick as you can, can you explain what each of these different parentheses-, brace-, and bracket-laden expressions does? ${save-items} ${C:tmp.txt} $($x=1;$y=2;$x;$y) (1,2,3 -join '*') (8 + 4)/2 $hashTable.ContainsKey($x) @(1) @{abc='hello'} {param($color="red"); "color=$color"} $hash['blue'] [Regex]::Escape($x) [int]"5.2" When you’re reading someone else’s PowerShell code, you will come across many of these constructs, and more. And you know how challenging it can be to search for punctuation on the web (symbolhound.com not withstanding) !