Category: PowerShell

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

  • 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 cmd.exe from the top navigation bar. Then…

    read more


  • Enabling TCP Connections in SQL Server

    Some network protocols are not enabled by default in SQL Server. We need to enable the option and restart the SQL Service to allow TCP connections. This post is a guide on how this is done:# On Windows via SQL Server Configuration Manager.# On Windows using PowerShell. Enable TCP/IP SQL via Server Configuration Manager 1.…

    read more


  • Adding & Removing SQL Features via Command

    This is a quick guide on how to add and remove features from SQL Server via command, following the theme of recent posts. The following areas will be covered within this post;# Check Features Installed on a SQL Server.# Installing a SQL Server Feature (Replication) via Command.# Uninstalling a SQL Server Feature (Replication) via Command.…

    read more


  • Install/Uninstall SQL Server via Command

    This is a post on installing SQL Server via command; I have a Windows Server 2016 Core running on a local Hyper-V test environment, and I’m installing SQL Server 2019, then uninstalling it. There’s 4 parts to this one;# Download a SQL Server ISO. # Mount the ISO on a Hyper-V Virtual Machine.# Install SQL…

    read more


  • Configuring Windows Server Core

    Windows Server Core is the CLI only version of the Windows OS. This post is a run-through of configuring a new Windows Server 2016 Core host, detailed in the following steps; # Installing Windows Server 2016 Core. # (CLI) Changing a Windows Server Hostname.# (CLI) Amending TCP/IP & DNS Settings.# (CLI) Joining a Windows Server…

    read more


  • Updating Help Documentation in PowerShell

    The Update-Help cmdlet in PowerShell will download the latest help files for PowerShell modules installed on your machine. Running PowerShell as Administrator is a requirement for this one, else you’ll get the following error. “Access is denied” is the key part in this error, amongst a lot of irrelevant info. And when you do run…

    read more


  • Count Rows within CSV Files using PowerShell

    This post contains a script that will help count rows within multiple CSV files using PowerShell. If you have a directory containing CSV files, this demo will walk you through how to count the rows of all CSV files within a folder. Counting rows within CSV files may be useful for verifying data from source…

    read more


  • Show Available Disk Space in SQL Server

    This blog post is to share a script that you can run in SQL Server (versions 2008 R2 and above) which shows the available disk space for all local volumes on a SQL Server host. I’m also including a quick note on how to get this information with remote PowerShell. Running out of disk space…

    read more