PowerShell
PowerShell blog sharing useful tips and tricks to boost efficiency, published by Peter Whyte, an experienced Microsoft SQL Server Database Administrator.
-
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.
-
How to Get and 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…
-
How to Install PowerShell on Ubuntu
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…
-
How to Silently Install SSMS
This is a note on how to silently install SQL Server Management Studio (SSMS) via command (PowerShell).
-
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.
-
Create a Firewall Rule with PowerShell (New-NetFirewallRule)
Create a Windows Firewall rule with New-NetFirewallRule, check it with Get-NetFirewallRule, then change, disable or remove it, with the SQL Server rules a DBA actually needs.
-
How to Check Your PowerShell Version ($PSVersionTable)
Run $PSVersionTable.PSVersion to check your PowerShell version. What the output looks like in Windows PowerShell 5.1 and PowerShell 7, why $host.Version can mislead, and how to check a script or a remote machine.
-
How to Run PowerShell Scripts with Task Scheduler
Automating PowerShell scripts is a much needed task for Windows Administrators. The Task Scheduler provides a reliable way to execute scripts on a predefined…
-
Restart a Service on Multiple Servers With PowerShell
📜Part of the PowerShell Complete Guide, every PowerShell post on this site, grouped by the job you are doing. To restart a service on several servers at once, run Restart-Service inside Invoke-Command with a list of computer names. Each server runs the command at the same time and the results come back to your console. […]