Category: PowerShell

PowerShell Video: Desired State Configuration (DSC)

PowerShell Simplification Learn to configure computers using PowerShell but with better syntax, less effort, and fewer errors using DSC. When configuring remote systems using PowerShell, it often can involve lots of hands-on time settings up environments, spinning up cloud instances, and running various scripts. This is not the only option! You can automate PowerShell processes. […]

PowerShell Write-Error Without Writing Stack Trace

Trouble Shooting Errors Recently, I was trying to display the errors and warning from a DotNet Build. While the warnings all displayed correctly, the errors always included the stack trace: I was able to control the error output slightly by varying the global $ErrorView variable, but the only two options were NormalView or CategoryView, neither of […]

How I Installed Software on a Server Using PowerShell

Installation I was tasked with installing custom and generic software on a dozen new servers. As an SDET, I have never done this type of task before, so I googled some methods for automating this process since manually installing each server was time-consuming. PowerShell seemed to be the logical tool for running through my list of tasks. I was […]

Moving Quickly Among Branches With PowerShell Dynamic Parameters

Efficiency Branches, anyone? I am currently working on a large integration project that uses a PowerShell script within each sub-module to manage building, deploying and even launching Visual Studio. Due to a reliance on code namespaces matching with folder structures, these PowerShell scripts are sprinkled all over a large directory structure. Fortunately, they are well-named […]

Essential .NET: PowerShell Just Keeps Getting Better

Improvements of PowerShell PSGallery Untrusted As a result, Find-Module works without issue. However, Install-Module will prompt you with an untrusted repository warning. To avoid this, assuming you do indeed trust the repository, you can set it to trusted with the command: Set-PSRepository -Name PSGallery -InstallationPolicy Trusted Apt-Get for Windows with PowerShell Package Management Those of […]

Using PowerShell’s Invoke-RestMethod to Access VSTS OData

How-to Access VSTS OData Given that Microsoft has abandoned their TFS CmdLets, one alternative is to access VSTS data is through the OData interface using the Invoke-RestMethod. Before you begin you need to setup Alternate authentication credentials by navigating to  Once these are established, you will likely want to save them to a local PowerShell […]

Deploying Windows Services With Psake and Web Deploy

A Simplified Way to Deploy New Releases At IntelliTect, a common pattern of our client solutions are windows services that process work on either a scheduled basis or watch a file location. We often use a combination of the Topshelf framework with the TopShelf.Quartz job scheduling package to solve these problems. These packages expose a […]

Removing Duplicate Entries From %PATH%

How-to Clean Up Your %PATH% As developers, we frequently end up with duplicate entries in our path. From the command line you can clean up your path using pathman.exe. Here’s a PowerShell Script to find the duplicates and remove them using Pathman.exe: $extraPath=(($env:path.Split(';') | group | ?{$_.Count -gt 1}).Values | %{$_[0]} pathman.exe /ru $extrapath Disclaimer: […]