• Just a DBA
  • Note
  • PowerShell
  • SQL Sushi
  • About
    • Kaiden

Just A DBA

Just A DBA

Category Archives: SQL Server

updating ps

19 Tuesday Mar 2019

Posted by KnowUR in PowerShell, SQL Server

≈ Leave a comment

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

Continue reading →

Recently

  • updating ps March 19, 2019

Categories

  • PowerShell (1)
  • SQL Server (1)

Arch

Blogs I Enjoy

Create a free website or blog at WordPress.com.

Articles - SQLServerCentral

Tutorial Gateway

Brent Ozar Unlimited®

Itzik Ben-Gan, Author at SQLPerformance.com

James Serra's Blog

Big Data and Data Warehousing

Aunt Kathi's SQL Server Home

Learn SQL Server from your favorite aunt!

Kevin E. Kline

Career and Technical Advice for the Data Professional

Microsoft SQL Server Integration Services

Kalen Delaney

Glenn Berry's SQL Server Performance

Semi-random musings about SQL Server performance

Paul S. Randal

Kimberly L. Tripp

    • Just A DBA
    • Customize
    • Sign up
    • Log in
    • Report this content
    • Manage subscriptions