Category: PowerShell

PowerShell & Windows Admin Blog Archives, by Peter Whyte, an experienced SQL Server Database Administrator.

  • How to Install Windows Terminal

    Windows Terminal (WT) is a modern command-line application for Windows that supports various shells such as PowerShell, Command Prompt, and Windows Subsystem for Linux (WSL). It offers a rich user experience with features like tabs, panes, and a customizable interface. Other benefits of Windows Terminal include Unicode /…

    Read More


  • How to Install Posh-Git on Windows

    posh-git is a PowerShell module that enhances your command line experience by displaying Git status information and providing tab completion for Git commands. This guide will show you how to install Posh Git on Windows using the Chocolatey Package Manager. As an afterthought, I’ve added notes at the…

    Read More


  • Install Chocolatey on Windows

    This post is a guide on installing the Chocolatey package manager on Windows by running a PowerShell command. Chocolatey allows you to manage software packages on your system with simple ‘choco’ commands. In this post after I install Chocolatey I’m installing a GUI to view all installed packages.…

    Read More


  • Enable Windows Subsystem for Linux (with Ubuntu 18.04)

    WSL allows Windows users to develop and run applications within a GNU/Linux environment. Previous to this feature release we needed VM’s or a dual boot setup. For more information, as always have a look at the Microsoft Docs. There’s a huge amount of tutorials and documentation on this…

    Read More


  • Removing Quotes from a CSV File with PowerShell

    This post explains how to remove quotes from a CSV file using PowerShell, a common requirement when working with CSVs that include unnecessary or problematic quotes. Whether you’re cleaning up data for easier processing or addressing formatting issues caused by quotes, this post will show you how to…

    Read More


  • “.ps1 cannot be loaded because running scripts is disabled on this system” PowerShell Error

    When attempting to run a PowerShell script you may receive the following error: cdk.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https://go.microsoft.com/fwlink/?LinkID=135170 This post is here to help you resolve this issue. The reason this is happening is…

    Read More


  • Testing Connectivity to Remote Server Ports with PowerShell

    All admins need a tool to test connectivity to remote servers on TCP ports. In Windows, this is commonly done using PuTTy or PowerShell. This post is a note on my favourite way of testing remote TCP connections in Windows, which is using PowerShell:> Check a Port is…

    Read More


  • Forcing Encryption in SQL Server

    If you’re ever planning to allow external connections to a SQL Server, one of the first things to ensure is that the data is encrypted at rest and in transit. SQL Server has an option where we can force all connections on a SQL Server to be encrypted,…

    Read More


  • Running PowerShell Scripts as Scheduled Tasks in Windows

    When you need something scheduled in Windows, the Task Scheduler is the tool at-hand. Running PowerShell (.ps1) scripts as Scheduled Tasks is done differently than differently than running regular .bat scripts. Sometimes I forget how it’s done, so a worthy enough post. Below I’m creating a daily reboot…

    Read More


  • How to Check What Features are Installed in SQL Server

    This is a quick guide on how to check which features are installed on a SQL Server. Open your SQL Server installation files. You may find them within the Setup Bootstrap folder (“C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\SQL2019”) or you might already have the ISO handy. We can open…

    Read More