Skip to main content

Posts

Showing posts from May, 2016

PowerShell Script to Check If Files Have Stopped Coming in

Introduction I am currently working in an environment where database backup files are generated on production servers and it gets replicated across to another data centre. The replication is done via a scheduled task in Windows Task Scheduler. The scheduled task merely runs the robocopy command with the appropriate parameters. Detecting if the Files Have Stopped Replicating One of the things I've learnt all these years is that if you forget to check if something is working, it ends up being that that's when it stops working. I have created a PowerShell script which will read a text file containing a list of folders it needs to check to determine if the latest backup files have come in or not. It will send an e-mail to the appropriate administrators. You can modify the PowerShell script to meet your needs, but I will use it as a way to demonstrate PowerShell programming. DISCLAIMER: It is NOT implied that it will work in your environment and that it will suit y

Downloading the latest PowerShell 5.1

To begin our tutorial on PowerShell, let's download the latest version of PowerShell. Microsoft has recently released PowerShell 5.1 (19th January 2017) . It is packaged with the Windows Management Framework 5.1. You can find this version by Googling or Binging "PowerShell 5.1". Just check the link that comes up is a Microsoft link before you click it. Otherwise, here is the link for Windows Management Framework 5.1 : https://www.microsoft.com/en-us/download/details.aspx?id=54616