I like to update PoweShell at regular intervals (on my Servers/Laptop), so that I have the latest updated files. I add a couple of steps to a SQL server job that runs each quarter.
Just like a lot of people; I like Star Trek. I thought it would be fun to incorporate a couple of fun wav files from the original series (I was a big fan). I do not do this on my Servers (Production or otherwise), there is no need for sound. This is strictly for my Laptop. For Servers, I omit the Powershell PlaySync function. Download a small wav file of your favorite sound, and Geek-out whenever this job runs.
I am sure there are better/different ways but, this is how I like to do it:
STEP 1: Plays a wav file letting you know the process is about to begin
powershell.exe -c (New-Object media.soundplayer "C:\some_path\st_init_upd.WAV").PlaySync();
STEP 2: Updates PowerShell file(s)
Update-Help -Force -ea 0
STEP 3: Writes results out to txt file, then plays a wav file stating the process is complete
Get-ChildItem -Path C:\Windows\System32\WindowsPowerShell\v1.0 -Recurse | Where-Object { $_.LastWriteTime.ToShortDateString() -eq (Get-Date).ToShortDateString() } powershell.exe -c (New-Object media.soundplayer "C:\Users\knowu\Documents\Visual Studio 2015\Projects\data_flow\data_flow\st_prog_comp.WAV").PlaySync();
Here is the t-sql script for the whole job…
USE [msdb]
GO
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0