PSEC - Powershell Enhanced Capability
Version 1.2.1

Task Execute for: Run Generic Script

Properties

Implemented Functions

getTaskDesc Function Meta


    function getTaskDesc([Task]$task) {
      return "Invokes $($task.name)-run.ps1 in $($task.execLocn)"
    }

params Function Meta



    # ---------- 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
    }

runScript Function Meta



    # ---------- 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"

    }

PSEC - Powershell Enhanced Capability
1.2.1

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

 

 

 

 

 

X