#Wait Until File is created
$logfile = "Log file name"
$TargetLogFile = "Path_To_File"
# example $logfile
= "Test.CSV"
# example $TargetLogFile =
\\$ServerName\C$\Temp\$logfile"
#()_.Wait for the log file
write-host "()_.Attempting to locate [$logfile]" -f yellow
do{
Write-host "()_.Please wait..." -f Cyan
Start-Sleep -Seconds 5
Write-host "()_.{$logfile] not there" -f Yellow
$path = Test-Path $TargetLogFile
if (!($TargetLogFile))
{Write-Host "()_.[$logfile] Not here yet..." -f Yellow
start-sleep -Seconds 5}
}
until($path)
Write-Host "()_.Located [$logfile]" -f Green
Write-Host "()_.Will continue" -f Yellow
|
Oz Casey, Dedeal
Principal Systems Engineer
https://smtp25.blogspot.com/
(blog)
https://twitter.com/Message_Talk
(Twitter)
No comments:
Post a Comment