Make your code faster with Profiler
Making PowerShell code faster has always been a difficult task. There are few DOs and DON’Ts of writing fast PowerShell code, but until now there was not a good way to measure what is actually happening.
Read MoreMaking PowerShell code faster has always been a difficult task. There are few DOs and DON’Ts of writing fast PowerShell code, but until now there was not a good way to measure what is actually happening.
Read MoreThis article is a part of a larger series on Pester. Last time, we looked at how assertions work in theory, and how they are implemented in Pester.
Read MoreThis article is a part of a larger series on Pester. Last time we looked at the theory of assertions and what mechanisms they use to fail our tests.
Read MoreThis article is a part of a larger series on Pester. I always found the word framework intimidating. It’s probably because my first encounter with the word was in .
Read MorePester has a great feature called TestCases. This feature enables you to easily call the same test code multiple times, but with different data.
Read MoreToday I will show how to defensively script against enums and how to test invalid enum values. What is an enum?
Read MoreAuthoring Pester tests is easy as it is, but if you are lucky enough to own a copy of ISESteroids 2 it now became even easier.
Read MoreIn this part of Pester basics series, I will cover the most powerful tool from the whole framework, the Mock function.
Read MoreThis is part two of Pester series of articles. In this article you will learn about the Context keyword, how to use all the assertions available in Pester and a bit about best practices.
Read MoreWhile we worked on Windows 8.1 deployment, we were required to make multiple keyboard layouts available on the Windows logon screen.
Read MoreSome time ago I stumbled upon the Pester framework that promised I would be able to test my scripts. This seemed to be super-useful for my day-to-day scripting, but unfortunately the learning curve was a bit steeper than I thought it would be.
Read MoreNote: This tip requires PowerShell 2.0 or above. Comparing two System.DateTime objects in PowerShell is really easy. All you need to do is:
Read MoreNote: This tip requires PowerShell 2.0 or above. In this very helpful tip, Bartek shown us how to create a custom object using the New-Module cmdlet and how to constrain the data the object can hold.
Read MoreNote: This tip requires PowerShell 2.0 or above. This week on a PowerShell forum, I stumbled upon user request to turn off his PC’s display on demand.
Read MoreIn a perfect world all date and time data available are represented by System.DateTime objects. In the real world we are usually not that lucky.
Read MoreThey say that PowerShell is the ultimate tool that provides almost infinite number of possible applications. So I wondered: What should I do to actually express infinity in PowerShell?
Read MoreCreating PowerShell custom objects is a common task that some find hard to do right. In this article I’ll show a sample code that has some of the common flaws.
Read MoreModifying a file always brings a risk of corrupting it; making a backup copy whenever possible is one of the file manipulation best-practices.
Read MoreOn one of the PowerShell forums someone asked for help with getting the 15 most used words in a webpage. The core of the answer to that question is amazingly clever use of a hash table.
Read MoreNote: This tip requires PowerShell 3.0 or above. The PowerShell ISE 3.0 brought a lot of new features. One of them is the ability to hide parts of the code by folding them.
Read MoreEvery now and then I find myself facing task I am not sure how to solve using without using native commands.
Read MoreGoing through folders, you sometimes find yourself in some strangely named ones you are sure you’ll have to revisit again. To avoid searching for the folders after some digging around, use the pushd (Push-Location) command to save your current location to stack.
Read MoreThe -replace operator takes a regular expression (regex) replacement rule as input and replaces every match with the replacement string. The operator itself is used as shown in the following schema: <input string> -replace <replacement rule>,<replacement string>
Read MoreSometimes you need to wait for an executable to finish its job. The typical case is a Setup.exe, but this behavior is also ideal candidate for cleaning up temporary files after an application has been closed.
Read MoreHave you ever wondered how often is your station rebooted? Let’s ask the Windows Event Log and get time of last five reboots.
Read More