Tag: PowerShell

PowerShell Video: Desired State Configuration (DSC)

Learn to configure computers using PowerShell but with better syntax, less effort, and fewer errors. 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. IntelliTect senior software engineer, […]

Using Enter-VsDevShell in PowerShell Consoles

A New Way to Add Visual Studio Tools to Your PowerShell Environment with Enter-VsDevShell PowerShell + Visual Studio == Awesome Until the 16.2.1 release1 of Visual Studio 2019, I used the inimitable PowerShell Community Extensions (PSCX) module to execute batch files to alter the current environment variables (PATH, etc.). I would use the Invoke-BatchFile cmdlet […]

PowerShell Write-Error Without Writing Stack Trace

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 which gave me […]

How I Installed Software on a Server using PowerShell

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 able […]

Moving Quickly Among Branches With PowerShell Dynamic Parameters

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 and exist in […]

Deploying Windows Services With Psake and Web Deploy

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 useful fluent interface to schedule multiple jobs […]

Removing Duplicate Entries from %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=(($path.Split(“`;”) | group | ?{$_.Count -gt 1}).Values | %{$_[0]} pathman.exe /ru $extrapath Disclaimer: Works for us.

Configuring Windows SMTP Server on Windows 2008 for Relay

My SMTP mail server requires that email be sent with TLS encryption and on port 587.  This makes it problematic for Team Foundation Server (TFS) to send emails directly.  To work around the problem, I installed the Windows 2008 SMTP Server service and configured it for relaying to my real SMTP mail server.  Install SMTP […]