we have DOS defined to start a process cmd.exe (DOS /C 'dir')
I'll start a powershell.exe instead of cmd.exe and define a VOC entry PS1 instead DOS
the I'll use it to launch ps1 script execution like
PS1 get-childitem
instead stating a DOS/cmd,.exe to launch a powershell
DOS /C "powershell -file myscript.ps1 -arg val -arg val "
any idea ?
------------------------------
Manu Fernandes
Infodata
------------------------------
we have DOS defined to start a process cmd.exe (DOS /C 'dir')
I'll start a powershell.exe instead of cmd.exe and define a VOC entry PS1 instead DOS
the I'll use it to launch ps1 script execution like
PS1 get-childitem
instead stating a DOS/cmd,.exe to launch a powershell
DOS /C "powershell -file myscript.ps1 -arg val -arg val "
any idea ?
------------------------------
Manu Fernandes
Infodata
------------------------------
I have a simple powershell script
$strString = "Hello World"
write-host $strString
The command to launch the powershell may need some modifiers such as 'DOS /C "powershell -ExecutionPolicy ByPass -file Helloworld.ps1"'
I then made it a paragraph and it works
Top of New "HELLOWORLD" in "VOC".
*--: I
001= PA
002= DOS /C "powershell -ExecutionPolicy ByPass -file Helloworld.ps1"
0*--: FI
Filed "HELLOWORLD" in file "VOC".
>HELLOWORLD
Hello World
>
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
I have a simple powershell script
$strString = "Hello World"
write-host $strString
The command to launch the powershell may need some modifiers such as 'DOS /C "powershell -ExecutionPolicy ByPass -file Helloworld.ps1"'
I then made it a paragraph and it works
Top of New "HELLOWORLD" in "VOC".
*--: I
001= PA
002= DOS /C "powershell -ExecutionPolicy ByPass -file Helloworld.ps1"
0*--: FI
Filed "HELLOWORLD" in file "VOC".
>HELLOWORLD
Hello World
>
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
thank you yes it works via DOS(cmd.exe) ,
but ... I'll bypass cmd.exe invoked by DOS to directly start a powershell.exe process !
------------------------------
Manu Fernandes
------------------------------
thank you yes it works via DOS(cmd.exe) ,
but ... I'll bypass cmd.exe invoked by DOS to directly start a powershell.exe process !
------------------------------
Manu Fernandes
------------------------------
To be clear are you asking on how to construct a verb to run a powershell directly from the UniVerse shell without using cmd.exe (i.e the DOS verb) ?
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
To be clear are you asking on how to construct a verb to run a powershell directly from the UniVerse shell without using cmd.exe (i.e the DOS verb) ?
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
------------------------------
Manu Fernandes
------------------------------
------------------------------
Manu Fernandes
------------------------------
Try This
>AE VOC PS
Top of "PS" in "VOC", 3 lines, 18 characters.
*--: P
001: V
002: powershell.exe
003: D
Bottom.
*--: EX
Quit "PS" in file "VOC" unchanged.
>PS -ExecutionPolicy ByPass -file Helloworld.ps1
Hello World
>
Thanks
Jonathan
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
Try This
>AE VOC PS
Top of "PS" in "VOC", 3 lines, 18 characters.
*--: P
001: V
002: powershell.exe
003: D
Bottom.
*--: EX
Quit "PS" in file "VOC" unchanged.
>PS -ExecutionPolicy ByPass -file Helloworld.ps1
Hello World
>
Thanks
Jonathan
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
02 AE VOC PS
Top of "PS" in "VOC", 4 lines, 20 characters.
*--: p
001: V
002: powershell.exe
003: D
004: I
Bottom.
The I on attribute 4 allows interrupt control for the processor mode.
Hope it helps you
Thanks,
Jonathan
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
02 AE VOC PS
Top of "PS" in "VOC", 4 lines, 20 characters.
*--: p
001: V
002: powershell.exe
003: D
004: I
Bottom.
The I on attribute 4 allows interrupt control for the processor mode.
Hope it helps you
Thanks,
Jonathan
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
May I request a little explain ?
UV Doc / SystemDescription says VOC
001 V (verb)
002 (processor) : you suggest 'D' dos batch files ; what about 'U' (OS Command) ? DOS(cmd.exe) is defined with a U processor.
003 (processor mode) : you suggest Interrupt control : what is the benefit ? DOS(cmd.exe) use TICERGM which is more rich.
007 ... DOS(cmd.exe) use a /Q on 007 (documented as reserved) . It seems the /Q is added to the cmd.exe statement (look at taskManager command-line) then can I add -ExecutionPolicy ByPass in these 007 field to add it on each execution ?
with kind regards
------------------------------
Manu Fernandes
------------------------------
May I request a little explain ?
UV Doc / SystemDescription says VOC
001 V (verb)
002 (processor) : you suggest 'D' dos batch files ; what about 'U' (OS Command) ? DOS(cmd.exe) is defined with a U processor.
003 (processor mode) : you suggest Interrupt control : what is the benefit ? DOS(cmd.exe) use TICERGM which is more rich.
007 ... DOS(cmd.exe) use a /Q on 007 (documented as reserved) . It seems the /Q is added to the cmd.exe statement (look at taskManager command-line) then can I add -ExecutionPolicy ByPass in these 007 field to add it on each execution ?
with kind regards
------------------------------
Manu Fernandes
------------------------------
In terms of the processor mode codes, there are some other options you can look at adding because as you state they are documented, although it's difficult to determine which will or will not be useful with the powershell. By all means try the PS entry I suggested with the same options that the DOS cmd has and see what happens.
The reason I looked at 'I' in particular was to ensure that the process will respond to Interrupt signals. My suspension is that without the 'I' the process will not respond to Interrupt signals correctly. Both UniVerse and UniData's code stream test for Interrupt signals at various points so placing the 'I' in the processor mode I believe it ensures compatibility with that signal handling (or it should from the best that I can work out).
As attribute 7 is noted as reserved (although it hasn't changed in it's use for a while) it is not used for every dispatch type and as it's reserved and not documented then I never recommend people to use it and we might decide to totally change it's use internally at some point.
I hope that answers all your questions on it.
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
In terms of the processor mode codes, there are some other options you can look at adding because as you state they are documented, although it's difficult to determine which will or will not be useful with the powershell. By all means try the PS entry I suggested with the same options that the DOS cmd has and see what happens.
The reason I looked at 'I' in particular was to ensure that the process will respond to Interrupt signals. My suspension is that without the 'I' the process will not respond to Interrupt signals correctly. Both UniVerse and UniData's code stream test for Interrupt signals at various points so placing the 'I' in the processor mode I believe it ensures compatibility with that signal handling (or it should from the best that I can work out).
As attribute 7 is noted as reserved (although it hasn't changed in it's use for a while) it is not used for every dispatch type and as it's reserved and not documented then I never recommend people to use it and we might decide to totally change it's use internally at some point.
I hope that answers all your questions on it.
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
Many thanks !
------------------------------
Manu Fernandes
------------------------------
we have DOS defined to start a process cmd.exe (DOS /C 'dir')
I'll start a powershell.exe instead of cmd.exe and define a VOC entry PS1 instead DOS
the I'll use it to launch ps1 script execution like
PS1 get-childitem
instead stating a DOS/cmd,.exe to launch a powershell
DOS /C "powershell -file myscript.ps1 -arg val -arg val "
any idea ?
------------------------------
Manu Fernandes
Infodata
------------------------------
I do this using Powershell Core. Version 7 is the current version of Powershell and found here on github https://github.com/PowerShell/PowerShell.
You will need to restart UV services after an install or update so UV can find pwsh.exe in the $env:path
>CT VOC PWSH
PWSH
0001 V Powershell Core
0002 pwsh
0003 D
0004 ACDEFGHIKMPRT
>PWSH -c $PSVersionTable
Name Value
---- -----
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Microsoft Windows 10.0.20270
...
>PWSH -f myscript.ps1
...
Regards,
Stuart
I do this using Powershell Core. Version 7 is the current version of Powershell and found here on github https://github.com/PowerShell/PowerShell.
You will need to restart UV services after an install or update so UV can find pwsh.exe in the $env:path
>CT VOC PWSH
PWSH
0001 V Powershell Core
0002 pwsh
0003 D
0004 ACDEFGHIKMPRT
>PWSH -c $PSVersionTable
Name Value
---- -----
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Microsoft Windows 10.0.20270
...
>PWSH -f myscript.ps1
...
Regards,
Stuart
ok, I'll give it a try.
Thanks
------------------------------
Manu Fernandes
------------------------------
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.