On both Windows and Linux, the chore of setting up developer workstations can take several days, and there always seem to be a few configuration settings that get missed. You can reduce the time and tedium dramatically by automating the process by using Vagrant to set up the operating system, followed by your choice of provisioning, configuration management and orchestration applications such as Puppet, Chef, Ansible, Salt, Docker, Chocolatey and Boxstarter. Vishwas shows how to make it easy to do with Vagrant, Chocolatey and Boxstarter.… Read more
When you combine PowerShell and SQLite, you can perform powerful magic. Phil Factor is in awe of SQLite and gives a brief demonstration of how easy it is to use. Just to encourage anyone who is unfamiliar with the database, he includes a giant-sized SQLite version of the old PUBS database that the first generation of RDBMS developers cut their teeth on. … Read more
Windows hasn't had a package manager in the style of the Advanced Packaging Tool (APT) of Linux distributions. Apt-get is a great way of installing packages and other software. We have Chocolatey, of course which has a growing library of software and even allows you to automatically update software. Now PowerShell has an 'official' way of using any system, such as NuGet, Chocolatey, GitHub or PSget. It is definitely useful and likely to mature into an indispensable tool for Windows users. Nicolas explains why… Read more
Why is it that we use XML, but with so little enthusiasm when it does so much, and is so feature-rich? Phil Factor argues that there are better ways of doing it, more complete than JSON, but easier to read than XML. To try to convince you, he gives a set of flying demos, using PowerShell and his PSYaml module, to illustrate how YAML can let you work faster, and more accurately.… Read more
PSYaml is a simple PowerShell module that I’ve written that allows you to serialize PowerShell objects to “YAML Ain’t Markup Language” (YAML) documents and deserialize YAML documents to PowerShell objects. It uses Antoine Aubry’s excellent YamlDotNet library To start, you can simply load the PowerShell file and the manifest from its home on GitHub PSYaml … Read more
A major difficulty for a System Administrator who wishes to provide access for auditors, Helpdesk staff, developers and other IT people is that adminstrator roles give users more access than they need. It is too easy to make mistakes, or to make more changes than those that were signed-off. With JEA, it is possible to create role-based access control (RBAC) endpoints that define precisely what actions you’ll let your users carry out without needing a elevated, privileged administrator credentials, and which log and report all operations.… Read more
Desired State Configuration (DSC) allows you to automate the way that you manage configuration data for software services as well as the environment in which these services run. DSC uses a set of built-in and custom 'resources' as the building blocks for a configuration. if you have specific requirements you may need to create the relevant resource to make the configuration happen. Nicolas Prigent provides a practical guide to DSC resources… Read more
To demonstrate that dynamic modules in PowerShell can be used to easily create objects with methods and properties, Phil Factor implements an expression analyser written in PowerShell, using a variation of Dijkstra's Shunting Algorithm.… Read more
It is just the first stage to make your C# Cmdlet do what it is supposed to do. Even though cmdlets are used at the commandline, they need a whole range of features to make life easier for the end user. These include such refinements as providing documentation, validating inputs, providing a manifest, and implementing the common parameters.… Read more
The Pull mode of Desired State Configuration (DSC) is more complicated to implement because you need to meticulously manage the MOF files and their naming conventions so as to ensure that you deploy your DSC configurations correctly. In this first article of a two-part series, Nicolas Prigent describes how you can best automate this, and then in a second part on monitoring DSC he describes techniques to help you to use the pull mode as a regular part of your admin work.… Read more
You can mould PowerShell to the way you want to work, with all the settings and modules that you require, by using the profiles. Profiles are PowerShell scripts that run at startup, and once you have understood where they are and when each is used, they have a whole range of uses that make using PowerShell a lot more convenient. … Read more
Automated configuration management is simpler with Desired State Configuration (DSC) and Push mode, but what is the best way to use DSC to automate deployments on your machines? 'Push' mode or 'Pull' mode? How can you reduce configuration-drift over time? Nicolas Prigent describes the second DSC deployment mode: Pull mode.… Read more
Now, it is easy to provide professional-quality documentation for PowerShell cmdlets, and to keep it in sync when you make changes, whether they are written in PowerShell or C#. Whereas this has always been easy to do in PowerShell, it was always painful to do in C# or VB because it meant having to build your own MAML file. Michael completes his three-part series by summarising, in a wallchart, how to go about it. … Read more
Developers who are already familiar with application languages will be baffled by different aspects of PowerShell to the beginner to programming. Laerte recalls his initial struggles with PowerShell and answers those questions he wished he'd found quick answers to. … Read more
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