PSEC - Powershell Enhanced Capability
Version 1.2.1

Script Name

create-data-run.ps1

Description

Used to remove an old file and create a new file after a specified delay. The configuration file provided the delay seconds. The task sends a notification when the file has been created.

Details

The Task to create the file completes immediately and initiates a background task to perform the file create.



param([Task]$task,[hashtable]$cfgParms,[hashtable]$brief)

$targFile = "$($task.execLocn)/$($cfgParms['file'])"
$sleepSecs = $cfgParms['sleep']
$task.tfs.globMap.creFile = $targFile;

$msg = "creating $targFile after $sleepSecs secs"
Remove-Item -Path $targFile -force


Start-Job -ScriptBlock {
  start-sleep $using:sleepSecs
  Set-Content -Path $using:targFile -Value $using:msg
  $wshell = New-Object -ComObject Wscript.Shell
  $Output = $wshell.Popup($using:msg)
}

$brief.createMsg = $msg
"$msg`r`nfinished`r`n";

PSEC - Powershell Enhanced Capability
1.2.1

Copyright © 2018-2021, 2022, Rexcel System Inc.

 

 

 

 

 

X