Name:run-generic-script
Type:script
Source:run-generic-script-lib.psm1
function getTaskDesc([Task]$task) {
return "Invokes $($task.name)-run.ps1 in $($task.execLocn)"
}
# ---------- define task parameters
function params([Object]$task,[hashtable]$htOpts) {
$parms = @{};
$parms.brief = "$($task.statlocn)"
$parms.str = "create Brief"
$parms.gen = "5"
$parms.genstr = "output line from parm definition line="
$parms.bool1 = $null
$parms['swkey='] = 'key-value';
return $parms
}
# ---------- the actual script
function runScript([Task]$task, [hashtable]$parms, [hashtable]$status) {
$tfs = $task.tfs;
$locn = $task.execLocn
$scr = "$($task.execLocn)/$($task.name)-run.ps1";
hlogBoth("Invoking $scr")
[hashtable]$parms = @{}
forEach($vbl in $task.taskCfg.keys) {
if ($vbl -match "^parm-") {
$key = $vbl.substring(5);
$parms[$key] = $task.taskCfg[$vbl];
}
#hlogBoth("$vbl value $($cfg[$vbl])");
}
$status.aInvoke = "Invoked $scr"
$retStr = (. $scr $task $parms $status)
return "$scr `r`n==================================run-reneric-script===================`r`n $retStr"
}
Copyright © 2018-2021, 2022, Rexcel System Inc.