Category: PowerShell

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

  • Running PowerShell Scripts as Scheduled Tasks in Windows

    When you need to schedule tasks in Windows, Task Scheduler is the tool for the job. Running PowerShell (.ps1) scripts as Scheduled Tasks differs from running standard batch (.bat) scripts. I often find myself needing a refresher on the process, so I decided to document it in this…

    Read More


  • How to Check Features Installed in SQL Server

    This guide explains how to check which features are installed on a SQL Server instance. When downgrading from SQL Server Enterprise to Standard, checking the installed features is crucial to ensure compatibility and avoid losing critical functionality. Some Enterprise features may not be available in the Standard edition,…

    Read More


  • How to Enable TCP/IP Connections in SQL Server

    Some network protocols, like TCP/IP, are disabled by default in SQL Server. To allow TCP connections, you need to enable them and restart the SQL Server service. Here’s a simple guide to do this via GUI & command: :> Option 1: Enable TCP/IP via SQL Server Configuration Manager.…

    Read More


  • Adding & Removing SQL Features via Command

    This post will guide you on how to add and remove features from SQL Server via the command line. The process includes checking installed features, installing a new feature (such as replication), and uninstalling a feature when no longer needed. The following areas will be covered within this…

    Read More


  • Install/Uninstall SQL Server via Command

    Installing and uninstalling SQL Server via command line can be useful, especially in environments without a GUI. In this guide, I’ll walk through installing SQL Server on Windows Server Core, in a local Hyper-V test environment. At the end I’ll also uninstall SQL Server from a PowerShell terminal…

    Read More


  • Guide for Setting Up Windows Server Core

    When you need to setup Windows Server Core, it’s useful to first familiarize ourselves with the key PowerShell commands that configure the server. Windows Server Core is a minimal installation option that provides a lightweight, command-line interface (CLI)-only environment, making it ideal for environments requiring lower resource usage…

    Read More


  • Updating Help Documentation in PowerShell

    Keeping your PowerShell help documentation up to date ensures you always have the latest guidance and reference materials for installed modules. The Update-Help cmdlet allows you to download and install the most recent help files, but you may encounter an access denied error if PowerShell is not run…

    Read More


  • Counting 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 many CSV files, this’ll help you count the rows of each CSV file within the folder. Counting rows within CSV files may be useful for verifying…

    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…

    Read More