Category: PowerShell
PowerShell blog sharing useful tips and tricks to boost efficiency, published by Peter Whyte, an experienced Microsoft SQL Server Database Administrator.
-
PowerShell for Windows Admins: The Complete Guide
Every PowerShell guide on this site grouped by task: files and folders, CSVs, the Windows Firewall, scheduled tasks, and the cmdlets worth knowing by heart.
-
How to Export Data to CSV in PowerShell
Export-Csv turns any PowerShell output into a spreadsheet. The three things worth knowing are -NoTypeInformation, calculated properties, and what encoding does to Excel.
-
How to Rename Multiple Files at Once with PowerShell
Renaming a hundred files by hand is nobody’s afternoon. Rename-Item with a script block does it in one line, and -WhatIf shows you the result before it happens.
-
How to Search for Text Inside Files with PowerShell
Select-String is the PowerShell answer to grep. It searches inside files, reports the line number, and works recursively across a whole folder tree.
-
How to Get a Folder Size in PowerShell
Windows Explorer will tell you a folder size eventually. PowerShell tells you in one line, and can do it for every folder on the drive at once.
-
How to Format Dates with Get-Date in PowerShell
Every script that writes a log or names a file needs a date in a specific shape. These are the Get-Date format strings worth committing to memory.
-
How to Get System Information with PowerShell
One block of PowerShell answers the questions you get asked about a server: what it runs, how much memory it has, how long it has been up, and how full the disks are.
-
How to Copy Files and Folders with PowerShell
Copy-Item handles most copying jobs in one line. For very large trees, or anything that needs to resume, robocopy is still the better tool and PowerShell drives it happily.
-
How to Zip and Unzip Files with PowerShell
PowerShell has zipped and unzipped natively since version 5. Two cmdlets cover almost everything: Compress-Archive and Expand-Archive.
Three guides collect the posts by the job you are doing rather than by date.
PowerShellFiles, CSVs, the firewall, scheduled tasks WSLInstalling it, distros, files across both worlds Windows AdministrationServers, domains, DNS, the tools worth havingThis site started as a SQL Server blog in 2017 and the archive is still here. The new SQL Server writing, and all the scripts, moved to a site of their own.
sqldba.blogScripts, error library, wait types, SSMS- Linux & WSL (28)
- Microsoft SQL Server (56)
- Other (11)
- PowerShell (52)
- Windows Server Admin (37)