PSEC - Powershell Enhanced Capability
Version 1.2.1

Task Execute for: Run Datastore Server

Properties

Implemented Functions

getTaskDesc Function Meta


    function getTaskDesc([Task]$task) {
      $tfs = $task.tfs;
      $gfn = $tfs.globMap.gaelGlobs.gfn;
      $desc = "Start Datastore Server - proj=$($gfn.gaelProj) curPort=$($gfn.curPort) dbPort=$($gfn.dbPort) locn=$($gfn.dbLocn)";
      $desc = $desc -replace "\\","/"
      hlogBoth("getTaskDesc $desc")
      return $desc
    }

params Function Meta



    # ---------- define task parameters
    function params {
      param([Object]$task)
      $parms = @{};
      $parms.brief    = "$($task.statlocn)"
      $parms.str      = "create Brief"
      $parms.gen      = "5"
      $parms.genstr   = "output line from parm defintition line="
      $parms.bool1    = $null
      $parms['swkey=']  = 'key-value';
      return  $parms
    }

    # ---------- define task options
    <#function options {
      param([Object]$task)
      $opts = @();
      $opts += @{type='input';  parm='gen';     label='Gen';     place='number of lines to generate'; regex='^[0-9]+$'}
      $opts += @{type='input';  parm='genstr';  label='GenStr';  place='string to generate'}
      $opts += @{type='input';  parm='genbrf';  label='GenBrf';  place='number of brief.GenArr lines to generate'; regex='^[0-9]+$'}
      $opts += @{type='check';  parm='bool1';   label='bool1';   place='turns on bool1 option when checked'}
      $opts += @{type='radio';  parm='trap';    label='trap';    valset='*/*no trap,fail/gen FAIL,trap/gen TRAP'}
      $opts += @{type='combo';  parm='combo';   label='combo';   valset='*/*--none--,green,red/show red,blue/set blue'}
      return  ,$opts
    }#>

runScript Function Meta



    # ---------- the actual script
    function runScript([Task]$task, [hashtable]$parms, [hashtable]$status) {
      $tfs = $task.tfs;
      $gfn = $tfs.globMap.gaelGlobs.gfn;
      $locn = "$($gfn.gaelicBase)".substring(0,"$($gfn.gaelicBase)".length - 4)
      $cmd  = "gcloud beta emulators datastore start  --data-dir=$($gfn.dbLocn) --host-port=localhost:$($gfn.dbPort)"
      $status.cmd = $cmd
      Start-Process -FilePath "C:\Windows\System32\cmd.exe" -verb runas -ArgumentList '/K',"$cmd"
      hlogBoth("Running datastore start script $($task.name) locn $locn")
      $status.sCondCode = "GOOD";
    }

PSEC - Powershell Enhanced Capability
1.2.1

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

 

 

 

 

 

X