I just wanted to do a quick shout-out to FeedSpot for including in in their list of Top 50 PowerShell blogs. Thank you for listing my blog along side all those other great blogs.
[Read More]Powershell: The many ways to use regex
Regular expressions (regex) match and parse text. The regex language is a powerful shorthand for describing patterns. Powershell makes use of regular expressions in several ways. Sometimes it is easy to forget that these commands are using regex becuase it is so tightly integrated. You may already be using some of these commands and not even realize it.
[Read More]Image from xkcd.com, slightly altered
Powershell: What have you done this month? May 2017
This is a breakdown of all the posts and other PowerShell projects that I worked on this month.
[Read More]Powershell: Your first internal PSScript repository
Setting up a basic internal repository for scripts and modules is surprisingly simple. I had no idea how easy this was for the longest time. If you are looking for ways to distribute your modules to others in your team, then you should consider this approach.
[Read More]Powershell: Building a Module, one microstep at a time
I am really quick to build a module out of my scripts and functions. I like how it allows me to organize my functions and use them in other scripts. I also see that many PowerShell scripters are slow to take that step of building a module. We often learn how to build a module without really understanding why they are built that way.
In this post, we will turn a common script scenario into a full module one step at a time. We will take several microsteps to show all the subtle details of why common modules are built the way they are. Lets take the mystery out of building a module to see how simple they can be.
[Read More]Powershell: Writing an alternate TypeExtension DSL, DSLs part 5
In my last post on DSLs, I broke down a proposed DSL that someone else had described. It was drafted specifically as an example DSL for a RFC. Today, I am going to propose an alternate DSL syntax and I am going to break down the implementation just like I did last time.
My real motivation for this is to break away from the way most DSLs are implemented. There is a strong tenancy to see every keyword as an advanced function that takes a string and a script block. I want to show that we have other options.
[Read More]Powershell: GetPlastered, a Plaster template to create a Plaster template
I recently started working with Plaster and I really like this module. I covered my first template in my Adventures in Plaster blog post last week. I have been pulling together ideas for more Plaster templates and I thought up a fun one to work on.
I am going to build a Plaster template that builds a Plaster template. I am calling this new template GetPlastered
.
This will be a good example demonstrating the TemplateFile features of Plaster.
[Read More]Powershell: Adventures in Plaster
David Christian recently wrote an article about how to use Plaster on OverPoweredShell.com. If you are new to Plaster, I pulled this from the Plaster readme.
[Read More]“Plaster is a template-based file and project generator written in PowerShell. Its purpose is to streamline the creation of PowerShell module projects, Pester tests, DSC configurations, and more. File generation is performed using crafted templates which allow the user to fill in details and choose from options to get their desired output.” -The Plaster readme.md
Powershell: PSGraph the Get-Help related links
I saw this tweet by Glenn Sarti where he was building a graph database of the PowerShell help system as a way to demonstrate Neo4j.
@MSFTzachal As promised I wrote my PowerShell Help graph presentation (PS Summit) as a blog post instead https://t.co/zuQzXf7ysy
— Glenn Sarti (@GlennSarti) May 7, 2017
I thought it was a cool idea and I was curious what I could do with my PSGraph module on that same dataset. I am pulling examples right from Glenn Sarti’s article because he did a great job explaining it.
[Read More]Powershell: Writing a TypeExtension DSL, DSLs part 4
Steffen Stranger pointed the PowerShell-RFC RFC0017-Domain-Specific-Language-Specifications out to me recently.
#psconfeu RFC proposes a C#-based mechanism for defining DSLs in #PowerShell. https://t.co/YF850s8Q01 cc @KevinMarquette @mcnabbmh
— Stefan Stranger (@sstranger) May 4, 2017
The RFC is about making it easier to implement a DSL in Powershell with C#. They have an example of a DSL to replace types.ps1xml
. It is a nice clear example of a DSL.
Powershell: What have you done this month? April 2017
Here is a breakdown of all the posts and other Powershell projects that I worked on this month.
Personal/Community efforts
These are the projects and idea that I do on my own time for the community. Most of my personal projects are published on this blog or as a contribution on GitHub.
[Read More]Powershell: Advanced Gherkin features in Pester 4.0
In the last post, I covered the bare basics of how to use Gherkin. I had a conversation with Joel Bennett on twitter about Gherkin and he pointed out some more examples from his Configuration module. Now that I have been playing with them for a few days, I decided it was time to share my findings.
This is the 2nd post in a 3 part series on Gherkin where I cover the advanced features. These features are the building blocks that give Gherkin a lot of power.
[Read More]SQL: Running SQL 2017 CTP 2.0 in Docker
I saw an announcement for SQL Server CTP 2017 CTP 2.0 recently and I wanted to try it out. I went to the eval page and I saw they have a Docker image for Windows listed for this release.
It had a fresh update on the Docker site but did not reference SQL 2017 at the time of writing this. I figured it was worth a try to save having to install the full engine on my surface.
[Read More]Powershell: Remote install software
I previously covered how to silently install a MSI. The next thing an administrator wants to do is install it on a remote system. That is the logical next step. This isn’t always the easiest task for someone new to PowerShell.
[Read More]PowerShell: Everything you wanted to know about exceptions
Error handling is just part of life when it comes to writing code. We can often check and validate conditions for expected behavior. When the unexpected happens, we turn to exception handling. You can easily handle exceptions generated by other people’s code or you can generate your own exceptions for others to handle.
[Read More]