Jakub Jareš

Powercfg.exe tips & tricks

Read more

Yesterday I had to write a script to do some initial setup on Windows and one of the steps was configuring power settings. I remembered that there were few useful options, but googling them did not help me. Luckily I found the pieces in an old script I wrote. So here are few tips for using powercfg.exe

Pester - Using Because in tests

Read more

This weekend I added custom failure reasons into Pester. This feature I know and love from Fluent Assertions, so let me show you how I would use it in Pester.

🔥 This feature is not released yet, get pre-release version 4.2.0-alpha3 to use it.

Because parameter

The new feature adds an optional -Because parameter to all Should assertions. The parameter allows you to specify a reason that will be shown when assertion fails, like so:

Using emojis in PowerShell code

Read more

Few days ago I saw a post about using hieroglyph unicode characters in Haskell to write fully functional haskell code. They shown an example of map function. A function that applies a function to a collection of items. Pretty much how foreach does in PowerShell.

I thought this was fun, and tweeted this:

Temporal tables in MSSQL 2016

Read more

The new version of MS SQL server offers a lot of new cool features. One of them is called system-versioned temporal tables.

As the name suggests, this feature enables versioning for data in table, it does quite simply by creating a second table that holds the historic state of each row, as well as information about the timespan in which the row was valid.

Testing class based DSC resources with Pester

Read more

I am using PowerShell version 5.0.10018.0 for the examples. This version of PowerShell ships with the WMF February 2015 Preview package that you can download here.

I was asked if there are any resources on testing class based DSC resources. And to be honest I am not sure. We shortly discussed the possibilities on the PS MVP mailing list, but I am still not sure what are the possibilities. So why not discover them while learning something more about the topic.

Luckily there are quite a few great resources on how to actually create a class based DSC resource, and what you need to do that. Some of them are:

Creating a Class based DSC Resource using PowerShell

Class-defined DSC resources in Windows Management Framework 5.0 Preview

Writing a custom DSC resource with PowerShell classes

Why do we test?

Read more

Lately we are getting some great questions on our Pester issue page, I am reposting soem of my answers as blog posts, because I hope they are worth reading. You can access the original question here.

We test because we need a simple set of boundaries that define a more complicated system. Coming up with simple tests and gradually refining them to define more complex systems is easy for us humans. Definitely easier than defining a complex system in a single swoop.

Lowering IO Priority of PowerShell Process

Read more

This week brought quite a few challenges. One of them was a question asked by a friend:

How do I search contents of all the files for given string, without killing the performance of the computer?

This seemed like a simple question to answer: Just lower the priority of the PowerShell process to Idle.

(Get-Process -Id $pid).PriorityClass = 'Idle'

The only problem is, that it does not work.