In class we had a project that required us to read in a text file that started with a users email address and then was followed by dates on the same line. The data file appeared as below JDoe@contoso.com,1/12/2012,1/13/2012,1/14,2012 JaneD@contoso.com,2/3/2012,3/4/2012 The requirement was for this script to run every morning and expire any accounts who had a date that matched the current date. Also, any accounts who’s expiration date was the previous day needed to be un-expired. Below is the code to do it. <# Function : Test - File Verifies that a file exists . Returns True is the file is present . #> Function Test-File { param ( $FilePath , $FileName ) $TestPath = $FilePath + "\" + $FileName $FileReady = Test-Path -path $TestPath Write-output $FileReady } #End: Test File <# . SYNOPSIS Confirms if a module is available . . DESCRIPTION Confirms if the provided parameter is available on the local c...
Welcome to the blogsite of MCTExpert. I am a Microsoft Certified Trainer. Here you will find the real questions that are asked to me by my students.