PowerShell's Desired State Configuration (DSC) framework depends on the Local Configuration Manager (LCM) which has a central role in a DSC architecture. It runs on all nodes that have PowerShell 4.0 or above installed in order to control the execution of DSC configurations on target nodes. Nicolas Prigent illustrates the role of the LCM in the 'Push' mode of configuring nodes.… Read more
'Desired State Configuration (DSC) is an essential part of the configuration, management and maintenance of Windows-based servers. It allows a PowerShell script to specify the configuration of the machine using a declarative model in a simple standard way that is easy to maintain and understand. Nicolas introduces the basic DSC concepts and provides a simple example of using the 'Push' model of DSC. … Read more
Although PowerShell is popular, for malicious intruders it represents a very attractive attack vector into your system. The obvious way of preventing this type of penetration is to detect when a script is altered. Not only must any script that is used for system or data administration be properly secured, but also any script that is used to maintain a PowerShell profile.… Read more
For many developers, understanding pipelining in PowerShell is like understanding reductive physicalism: you think you've just about got it, and then the brain blue-screens. Michael Sorens is inspired by his several efforts to explain pipelining on StackOverflow to attempt the definitive simple explanation for the rest of us.… Read more
It is the punctuation, the strange dollar signs, brackets and parentheses that bewilder anyone learning PowerShell. Add to that the aliases and you can bewilder everyone. The punctuation is essential, so here is the the complete PowerShell wallchart and guide to Powershell Punctuation. PowerShell need no longer be perplexing.… Read more
It's great to be able to monitor a counter or any other changing metric while engaged in development work. You'd think that the two alternatives would be using a third-party tool or hacking a PowerShell script. Well no, because there could be an existing open-source PowerShell module that would do it for you, and with a little customization could give you precisely what you need.… Read more
The one question about PowerShell that trips up almost everyone is about when and how to quote strings. Because PowerShell replaces the old command shell, it has to be able to work the way that it did with string parameters, but it also has to behave like a .NET scripting language to replace VBA. PowerShell grapples with this apparent contradiction, and manages to square the circle. Michael Sorens explains the how and when of PowerShell quoting.… Read more
By reading performance counters from services such as SQL Server or Exchange, you can get a wealth of performance information. By automating the process of gathering and storing appropriate counters, you can routinely check a range of devices quickly using visual tools such as PerfMon. By then creating your own counters, you can add counter-based metrics to anything that can be measured programmatically, such as services, applications, processes such as ETL, or deployments. … Read more
One of the downsides of learning a new computer language is that transfer of training doesn't always work to your advantage. In fact, the habits you picked up in the past may now cause confusion. In this poster or wall-chart for long walls, Michael Sorens selects the thirty-six most common causes of confusion for anyone getting to grips with PowerShell. Forewarned is forearmed.… Read more
WMI (Windows Management Instrumentation) is the basic way of querying and changing basic information about any windows server, including SQL Server or Exchange Server. It provides a logical structure and representation of systems and services that are hosted on the server and is essential for anyone who is keen to automate routine monitoring and administration work via PowerShell, especially where many servers are involved in the task.… Read more
There are some pitfalls in PowerShell for the unwary. Many people who are learning PowerShell come across quirks that can cause frustration. Michael Sorens continues his series, warning abut the most common PowerShell pitfalls and explains how to avoid them.… Read more
If you are aiming to optimise the use of your time by doing as much as possible via scripting, you will soon want to run scripts in parallel to save time. PowerShell does not demand that you run jobs one after the other; It has the means to launch actions whenever you wish and to obtain the results when you want them.… Read more
PowerShell has some very valuable features, but it is a mistake to believe that all those skills that you've derived from more conventional programming languages will transfer over to PowerShell. There are some pitfalls for the unwary. Michael Sorens warns abut the most common PowerShell pitfalls and explains how to avoid them.… Read more
Pester offers a relatively small number of commands to Unit-test PowerShell scripts, but these commands have tremendous capabilities. Pester even gives you the means to validate data and test program flow. It uses 'mocks' to provide hooks to validate program flow, so you can be more confident that a function is doing things they way you intended.… Read more
Pester allows you to automate the testing of PowerShell scripts. It can test the output of a function as you develop it by validating simple data (scalars) and arrays, Pester allows you to focus on the one function you want to test by using 'mocking' to fake all the other functions and Cmdlets, It also uses Parameterized tests save you from writing essentially the same test over and over with just a different input valu… Read more
By the time you're using PowerShell to automate an increasing amount of the system administration, database maintenance, or application-lifecycle work, you'll probably need to automate the unit-testing of the PowerShell scripts themselves. Michael Sorens introduces you to Pester, the leading test framework for PowerShell, and shows how it can make it easier to produce reliable scripts… Read more
You can execute PowerShell code that creates the data of an object, but there is no cmdlet to generate the 'object notation' code from an existing PowerShell object; until now, that is. Phil Factor also produces a ConvertTo-YAML function and explains how they both work, with illustrative cod… Read more
So you've got your database under source control, and now you want to start running automatic tests and builds with it. Welcome to the world of continuous integration. Rob Chipperfield guides us through the fundamentals of continuous integration servers, with advice on what to think about when choosing one, and insights into how your database and application structures can affect your choice.… Read more
In the grand finale to Michael Sorens' series of PowerShell one-liners, we come to the handling of data, reading it in and writing it out, whether by files; input/output streams or a database. It shows how it can be done in a variety of formats including CSV, JSON, and XML.… Read more
The way to learn PowerShell is to browse and nibble, rather than to sit down to a formal five-course meal. In his continuing series on Powershell one-liners, Michael Sorens provides Fast Food for busy professionals who want results quickly and aren't too faddy. Part 3 has, as its tasty confections, collections, hashtables, arrays and strings.… Read more