- Aug
- 2,320
- 111
@PSET is a variable function from the SYSUTILS plugin, available from;
https://jpsoft.com/all-downloads/plugins-take-command.html
I am using the 64-bit version of SYSUTILS, as I am using the 64-bit version of both TCC and Powershell.
From the SYSUTILS.TXT file,
Here is how to create, from TCC, an environment variable in Powershell.
The version of TCC I am using is;
The version of Powershell I am using is;
From 64-bit TCC, load the plugin;
Find the PID of powershell. Note well that I have only 1 copy of Powershell active.
Place the environment variable into Powershell;
Did it work? In Powershell, examine the variable;
In Powershell, change the variable;
Did it work? Let's verify;
Back in TCC, get the variable we changed in Powershell;
What can this be used for? Well, my first thought is interprocess communication, that is, sharing data between applications. YMMV
Joe
https://jpsoft.com/all-downloads/plugins-take-command.html
I am using the 64-bit version of SYSUTILS, as I am using the 64-bit version of both TCC and Powershell.
From the SYSUTILS.TXT file,
Code:
@PSET
@PSET[pid,var[=[value]]]
get[unset[set]] variable in process <pid>
returns value (get/set) or var (unset) on success, else an empty string
Here is how to create, from TCC, an environment variable in Powershell.
The version of TCC I am using is;
Code:
TCC 18.00.32 x64 Windows 7 [Version 6.1.7601]
TCC Build 32 Windows 7 Build 7601 Service Pack 1
The version of Powershell I am using is;
Code:
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.14409.1005
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1005
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
From 64-bit TCC, load the plugin;
Code:
plugin /l sysutils64.dll
Find the PID of powershell. Note well that I have only 1 copy of Powershell active.
Code:
set thepid=%@pid[powershell.exe]
Place the environment variable into Powershell;
Code:
echo %@pset[%thepid,mydate=%_isodate]
Did it work? In Powershell, examine the variable;
Code:
get-item env:mydate
Name Value
---- -----
mydate 2017-10-02
In Powershell, change the variable;
Code:
$env:mydate = "2017-11-02"
Did it work? Let's verify;
Code:
get-item env:mydate
Name Value
---- -----
mydate 2017-11-02
Back in TCC, get the variable we changed in Powershell;
Code:
echo %@pset[%thepid,mydate]
2017-11-02
What can this be used for? Well, my first thought is interprocess communication, that is, sharing data between applications. YMMV
Joe