Category: PowerShell
PowerShell & Windows Admin Blog Archives, by Peter Whyte, an experienced SQL Server Database Administrator.
-
How to Open PowerShell as Administrator
Running PowerShell commands with elevated privileges is often necessary when configuring system settings, installing software, or troubleshooting issues. This post covers most methods to open PowerShell as an administrator on Windows, ensuring you have the necessary permissions for advanced operations. Methods Covered in This Guide:1. Open PowerShell as…
-
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…
-
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…
-
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–…
-
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…
-
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:…
-
Create a New Firewall Rule with PowerShell
This is a short post to share a PowerShell script that will create a new Windows Firewall Rule on a your computer. We have to ensure that we run PowerShell as Administrator for this to work. The above is creating a new firewall rule so inbound SQL Server…
-
How to Check PowerShell Version
This guide explains how to check your PowerShell version on a Windows computer using the $PSVersionTable command. Running the latest PowerShell version ensures access to new features and cmdlets. Some scripts may rely on commands not available in older versions, causing compatibility issues. We should keep it up-to-date…
-
How to Automate PowerShell Scripts with Task Scheduler
Running PowerShell scripts on a schedule is a common requirement for Windows Admins. This guide will show you how to automate your scripts using Task Scheduler, covering both the GUI and PowerShell methods. Task Scheduler allows you to run programs, scripts, or other tasks based on a schedule…
-
SQL Server Default Port
The default port for the SQL Server Engine is 1433, which is a key thing to know if you’re working as a Database Administrator (DBA), especially when managing network configurations or troubleshooting connectivity issues. In my experience, SQL Server runs on port 1433 about 95% of the time.…
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)