Category: PowerShell
PowerShell & Windows Admin Blog Archives, by Peter Whyte, an experienced SQL Server Database Administrator.
-
How to Check Windows Firewall Status with PowerShell
Want to quickly check whether your Windows Firewall is enabled or disabled? This guide shows you how to use PowerShell to get the status of your local Windows Firewall for each profile. PowerShell cmdlets follow a standard format: verb-noun. The verb describes the action, and the noun specifies…
-
How to Enable Windows Firewall using PowerShell
Windows Firewall is an essential security feature that protects your system from unauthorized access and threats. If it has been disabled for testing or mistakenly turned off, you can quickly re-enable it using PowerShell. This guide provides a straightforward process to restore your firewall settings and ensure a…
-
How to Disable Windows Firewall with PowerShell
This post provides a demo on how to disable Windows Firewall with PowerShell on a Windows computer. ⚠ Important: Disabling the Windows Firewall is not recommended as it reduces your system’s security. However, there are scenarios, such as troubleshooting, where temporarily disabling the firewall may help identify if…
-
The Best Terminal for Windows
This is a post to share an opinion on the best Terminal for Windows, which is Windows Terminal. The easiest way to install Windows Terminal is by following this link which takes you to the Microsoft Store, we can one click download/install from there. Windows Terminal is installed…
-
Creating Folders (If Not Exists) with PowerShell
If you need to create folders or subfolders in PowerShell only when they don’t already exist, this quick script will help. The script uses Test-Path to check if the folder exists before running the New-Item command. This snippet is ideal for anyone searching for a fast and reliable…
-
Advanced File and Folder Creation with PowerShell
This post contains an advanced guide for creating and managing files and folders in PowerShell. It builds on the basics introduced in my previous post, PowerShell Guide: Creating Folders and Files, and includes more techniques useful for a DBA or Sysadmin. Contents: 1. Creating New Files and Folders2.…
-
How To Change From WSL2 to WSL1
This is a post on how to change a Windows Subsystem for Linux (WSL) Distribution from running on Version 2 to Version 1. Windows Subsystem for Linux (WSL) supports two versions:> WSL2: The latest version with full Linux kernel support, offering better compatibility and performance. > WSL1: The…
-
How to Manage S3 Buckets with AWS CLI
This is a post on how to help manage S3 Buckets with AWS CLI, and to help explain some local Operating System (OS) considerations when running such commands. First of all, you will need to be authenticated to your AWS Account and have AWS CLI installed. I cover…
-
Delete Files Older Than in PowerShell
Here is an example of how to use PowerShell to delete files older than a specified date: This script will delete all files in the specified folder that have the last write time older than 30 days from the current date. You can adjust the $maxAge and $folder…
-
Get-EventLog in PowerShell
The Get-EventLog cmdlet in PowerShell can help you view events as you would in Event Viewer, but within your PowerShell Terminal. In this post I’ll share a few examples of use: # Get List of Event Logs Available# Show Events by Count# Show Events by Message Name# Show…
Recent Posts
- How to Get SQL Server’s IP Address
- Identify Missing & Unused Indexes in SQL Server
- SQL Server Performance Tuning: Index Fragmentation Scripts
- Show User Activity and Blocking in SQL Server
- Download and Install SQL Server Management Studio (SSMS)
Categories
– AWS
– DBA Stories
– Linux
– MySQL
– Other
– Postgres
– PowerShell
– Redshift
– SQL Server
– Windows Server
Tags
Always On Availability Groups (AAG) (3) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (71) Database Backups & Recovery (13) Database Mirroring (2) Deleting Data (1) Error Messages (4) 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 (4) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (14) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (1) SQL Server Processes (5) SQL Server Replication (1) SQL Server Scripts (12) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (20)