PowerShell Profile

If possible, add an entry to TCMD.INI that would allow the use of a users PowerShell Profile with PSHELL and @PSHELL;
PS C:\utils> $Profile
Not sure if this is the product used with TCMD, but according to https://www.nsoftware.com/kb/articles/inscript.rst

PowerShell Profiles
If you have a PowerShell profile with variables and functions already defined, it can be loaded with the PowerShell component by setting the LoadProfiles property to true before calling Eval or EvalFile.
view sourcepowershell1.LoadProfiles = true;powershell1.Eval(script);
The PowerShell component will look for profiles in the following locations:
  • %windir%\system32\WindowsPowerShell\v1.0\profile.ps1
  • %windir%\system32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
  • %UserProfile%\My Documents\WindowsPowerShell\profile.ps1
  • %UserProfile%\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1