Category: PowerShell

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

  • Get-Command in PowerShell

    Get-Command is a cmdlet in PowerShell that lets you retrieve a list of all available commands in your current session. It’s a go to tool for discovering new commands and understanding their usage and capabilities. You can use Get-Command with wildcards to filter results based on patterns. This…

    Read More


  • Create Folder If Not Exists in PowerShell

    Creating folders programmatically can streamline tasks and ensure that required directory structures are in place. In this guide, we explore a simple yet effective PowerShell script to check if a folder exists and create it if it doesn’t. By leveraging the Test-Path and New-Item commands, you can automate…

    Read More


  • Get-TimeZone in PowerShell

    The Get-TimeZone cmdlet in PowerShell retrieves the current time zone of a computer. It can also list all available time zones, which is helpful if you’re planning to make changes to the system’s time zone settings. In this post I’m sharing two examples of how to check the…

    Read More


  • Get-Service in PowerShell

    The Get-Service command in PowerShell is the tool for listing, filtering, and managing the services running on a computer. This quick guide is aimed at helping you understand it’s capabilities, with examples that sysadmins will find especially useful. Contents:> Listing All Services on a Computer> Filtering Services by…

    Read More


  • How to Install and Configure AWS CLI on Windows

    This post is a how-to for installing & configuring AWS CLI (Version 2) on Windows. In this guide, we’re going to download the AWS Command Line Interface installation media and run through the simple installation. Once done we’ll configure AWS CLI, which you’ll need an AWS Account to…

    Read More


  • How to Install Ubuntu 20.04 on WSL

    This guide shows how to install Ubuntu 20.04 on WSL (Windows Subsystem for Linux). Before installing a WSL Linux distribution you should have already enabled WSL on your computer. All WSL Linux distributions are available for download in the Microsoft Store. This is the easiest way to install…

    Read More


  • Viewing Windows Event Logs with PowerShell

    In this post, we will explore how to use PowerShell to view event logs. We will use the Get-EventLog command to accomplish this, listing event types available and then show recent events. 1. List Available Event Log Types To display all event log types on a system, run…

    Read More


  • Open Current Folder in PowerShell

    When working in a PowerShell terminal session, you might want to open Windows Explorer to view the current directory. This guide is a simple guide to demo how to open the current working directory directly from PowerShell. Using Invoke-Item to Open the Current Folder The Invoke-Item cmdlet lets…

    Read More


  • PowerShell Guide: Creating Folders and Files

    This guide walks you through the steps to create new files and folders using PowerShell. Additionally, at the end I’ll show how to add text to files directly within PowerShell. The New-Item cmdlet will create new files or folders in PowerShell. By adjusting the -ItemType parameter to File…

    Read More


  • Installing oh-my-posh On Windows

    Oh-my-posh is a theme engine for PowerShell that enhances your terminal with custom themes. It integrates with posh-git to display useful indicators for Git repositories, failed commands, and admin status. This quick guide will walk you through installing Oh My Posh and setting a theme using Choco on…

    Read More