AppWorx, Dollar Universe and Sysload Community

 View Only
  • 1.  Running $U commands in PS and PS Uprocs

    Posted Aug 08, 2019 09:36 AM
    Edited by Angus Reid Aug 08, 2019 10:10 AM
    ​$U 6.9 Windows 2012 R2

    Wanting to expand the use of $U which has a default command (MS DOS) language into PS.  Commands that would have originally been done in a CL_INT type Uproc could now be done in PS.  Things like

    • %UXEXE%\uxlst task which would be in dos "%UXEXE%\uxlst" TSK EXP SES=* UPR=* MU=* FULL 

    This can be done from command window after loading the $U environment or in a CL type uproc which does the same by default.

    In PS window it is possible to load the $U environment using the following command with a '&' to prefix the string command.

    • &"C:\Program Files\AUTOMIC\DUAS\<node_name>\mgr\uxsetenv.bat"

    However when running Get-ChildItem ENV: in PS after the environment is loaded the $U variables do not evaluate. For example $UXEXE or $ENV:UXEXE so the above command cannot be translated into PS and does not evaluate. 

    I suspect this is more a PS thing than $U, is there a way to do this as this would open the door to calling $U commands within PS scripts and PS type Uprocs.  Really just wanting to run 'old' dos commands within PS as the syntax is more familiar and not sure if there a PS equivalent to these commands yet in $U.


    What have I missed?​


  • 2.  RE: Running $U commands in PS and PS Uprocs
    Best Answer

    Posted Sep 03, 2019 04:39 PM
    Hi,

    I use $U command within my PS CL_INT uprocs, my main usage is setting inheritance variables, see below:

    &${env:UXEXE}\uxset hvar ID_DEPOT_DGP=${id_depot_dgp}

    So your uxlst task command should be:

    &${env:UXEXE}\uxlst TSK EXP SES=* UPR=* MU=* FULL 

    You don't need to load $u environment within CL_INT

    Just don't forget to set the shell from DEFAULT to POWERSHELL

    Hope this helps