No longer seen as a gimmick, PowerShell commands and scripts are an integral way for sysadmins to manage their estate.

Sometimes a script is very low effort... you'll run it once and will never need to perform that task again. If it's something that you'll use regularly, and that can take some time to run (against multiple items in a loop), consider adding a progress bar so you can a) track progress and b) know for sure that it hasn't stopped somewhere.

It essentially comes down to one command: Write-Progress -Activity 'thing that is running' -Status "Processed item number $count" -PercentComplete $percentComplete

For this to work, set a counter before you enter a foreach loop (or use the counter in a for loop), and at the end of each iteration, increment the counter, work out the percentage complete and run the Write-Progress cmdlet. For example:

$total = 400

for ($i=1; $i -le $total; $i++) {
	
	# Doing some really important stuff here
    
	$percent = ($i / $total) * 100
    Write-Progress -Activity 'Doing stuff..' -Status "Doing thing $i of $total" -PercentComplete $percent
}

Not only is this useful for tracking your own scripts, but it adds to the UX when someone else needs to use your script (or even built upon it / call it from their own script).