Category: PowerShell

PowerShell blog sharing useful tips and tricks to boost efficiency, published by Peter Whyte, an experienced Microsoft SQL Server Database Administrator.


  • Sudo for Windows: A Quick Overview

    With the release of Windows 11 version 24H2 in September 2024, Microsoft introduced Sudo for Windows, adding Linux-like functionality for managing system privileges. Having Sudo on Windows allows us to execute commands with administrative rights directly from a non-elevated console session, making it easier to run administrative tasks…

    Read More


  • PowerShell Tail: A Familiar Approach to Log File Monitoring

    In the Linux world, the tail command is a go-to tool for monitoring logs in real-time. While Windows doesn’t have a direct equivalent, PowerShell’s Get-Content -Tail command provides similar functionality for log monitoring. To help bridge the gap for Linux users and improve log tracking in Windows, this…

    Read More


  • How to Open PowerShell as Administrator

    This post covers most various ways for how to open PowerShell as Administrator on Windows, ensuring you have the necessary permissions for advanced operations. Running PowerShell commands with elevated privileges is often necessary when configuring system settings, installing software, or troubleshooting issues. I think most tasks in my…

    Read More


  • PowerShell Script: List Files with Sizes and Dates

    In this blog post, we’ll go through the steps for using a PowerShell script that lists files in a directory along with their sizes and creation dates. This script is useful for disk space and for checking old files in a folder.  List Files with Size and Last…

    Read More


  • Removing Quotes from all CSV Files in a Directory

    Managing CSV files often involves cleaning up data before processing. A common task is removing unwanted quotation marks from the contents of CSV files. I wrote a blog post on how to remove quotes from a single CSV file using PowerShell some years ago, which I have just…

    Read More


  • How to Set Environment Variables in PowerShell

    Environment variables store key information on your system that programs can use to influence their behavior. For example, the AWS CLI uses the AWS_REGION variable to determine the region for API requests. This guide will cover:– Listing all environment variables– Retrieving the value of a specific environment variable–…

    Read More


  • How to Install PowerShell on Ubuntu 20.04

    This guide will walk you through installing PowerShell on Ubuntu 20.04. I’m doing this on Windows Subsystem for Linux (WSL), and have not encountered any compatibility issues with the PowerShell & Ubuntu combo. For the latest updates on PowerShell installation, version compatibility, and support dates, refer to MS…

    Read More


  • How to Silently Install SSMS

    This is a note on how to silently install SQL Server Management Studio (SSMS) via command (PowerShell). SSMS is a tool most people use when working with SQL Server. If you need to install SSMS on multiple computers, you may want to use the silent installation feature for…

    Read More


  • How to Delete Files in PowerShell

    This is a post on how to delete files in PowerShell, which will be useful when you need to delete files as part of a script in Windows. This post covers the following:> PowerShell: Delete a File> PowerShell: Delete a Folder> PowerShell: Delete Files in Subfolders Recursively PowerShell:…

    Read More