Author: Peter Whyte
-
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.
-
Sudo for Windows: How to Enable and Use It on Windows 11
Sudo for Windows came with Windows 11 24H2. Turn it on in Settings, then run elevated commands from a normal terminal. Not available on Windows Server.
-
Log and Filter sp_who2 Results in SQL Server
When managing SQL Server performance, the built-in sp_who2 procedure is a commonly used tool for quickly checking active processes and their resource usage…
-
PowerShell Tail: Get the Last Lines of a Log File With Get-Content
Get-Content -Tail shows the last lines of a log file, the PowerShell answer to the Linux tail command. Plus a Tail function that colours errors and warnings.
-
How to Filter Objects in SSMS
SQL Server Management Studio (SSMS) offers a quick filtering feature that lets you narrow down your search by criteria such as name, schema, or creation date…
-
SQL Server Script: Enable or Disable All SQL Agent Jobs
SQL Server Agent jobs automate tasks within SQL Server, but there are times when you need to enable or disable multiple jobs, such as during maintenance…