Category: PowerShell
PowerShell & Windows Admin Blog Archives, by Peter Whyte, an experienced SQL Server Database Administrator.
-
Managing Old Files with PowerShell
Managing disk space is a common task for IT professionals, especially when dealing with folders that accumulate temporary or outdated files. Using simple PowerShell Script, we can quickly check and delete files older than a given date. In this post, I’ll cover: Reviewing Files for Cleanup: Generate a…
-
Using Get-EventLog in PowerShell
The Get-EventLog cmdlet allows you to view event logs directly in your PowerShell terminal, similar to using Event Viewer. Below are some quick examples to get started:1. List Available Event Log Types2. Show Events by Count3. Filter Events by Message4. View Full Message of an Event 1. List…
-
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…
-
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…
-
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…
-
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…
-
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…
-
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…
-
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…
-
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…
Recent Posts
- How to Open PowerShell as Administrator
- How to Filter Objects in SSMS
- The Evolution of Microsoft SQL Server
- SQL Server Script: Enable or Disable All SQL Agent Jobs
- Database cannot be opened, it is in the middle of a Restore
Categories
– AWS
– DBA Stories
– Linux
– MySQL
– Other
– Postgres
– PowerShell
– Redshift
– SQL Server
– Windows Server
Tags
Always On Availability Groups (AAG) (4) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (76) Database Backups & Recovery (14) Database Mirroring (2) Deleting Data (1) Error Messages (5) Git Commands (5) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) PowerShell Scripts (1) SQL Server Agent (5) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (15) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (2) SQL Server Processes (5) SQL Server Replication (2) SQL Server Scripts (13) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (19)