Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

PSHELL not working in TCC 26

Sep
4
0
Cant get Pshell or @pshell to work... I suspect a path error, but it looks correct to me.
I always get the following message:

pshell /s "d:\utils\Toast.ps1" (I've tried with and without the double quotes and with single quotes)
PSHELL: The library file is missing or specified functions can't be found.

Version and path is provided below. Is there a need for some type of environment varible? Please help

NSILP_PowerShell.x64.dll is located in the path..

path is set to:

C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
D:\Program Files\PuTTY\
C:\Users\Zeppo\scoop\shims
C:\Users\Zeppo\AppData\Local\Microsoft\WindowsApps
d:\utils\btmscripts
d:\utils\gawk\bin
d:\gcc\bin
C:\Program Files\JPSoft\TCMD26
C:\WINDOWS\SYSTEM32
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
c:\Windows\System32\WindowsPowerShell\v1.0



TextUtils v0.81.0 loaded.

TCC 26.02.43 x64 Windows 10 [Version 10.0.19043.1348]
Copyright 2020 JP Software Inc. All Rights Reserved

TCC 26.02.43 x64 Windows 10 [Version 10.0.19043.1348]
 
I don't think a PATH entry is needed. Here, NSILP_PowerShell.x64.dll is in TCC's installation directory (and not in the path) and TCC finds it OK. It's likely that this has something to do with the PowerShell version and/or what's in Toast.ps1. Does the script work when run from PowerShell?
 
thx for the quick response...

Toast.ps1 works in both in native powershell and in a powershell window that I created in TCC.
PS C:\Users\Zeppo> Get-Host | Select-Object Version

Version
-------
5.1.19041.1320

Also I am running the following version of .NET
(Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Version
4.8.04084
 
Does toast.ps1 require anything (a function perhaps) that's defined in profile.ps1? And is profile.ps1 in the default place?

As a test, I made a "show-notification" function and put it in C:\Users\vefatica\Documents\WindowsPowerShell\profile.ps1. Then I made this script.

Code:
v:\> type toast.ps1
show-notification foo bar

The command pshell v:\toast.ps1 works here in TCC v26.
 
FWIW, my Windows is 10.0.19043.1348 (2009, 21H1), my PowerShell is 5.1.19041.1320, and I tested with TCC 26.02.43 x64
 
I dont have a profile.ps1 defined anywhere. Do I need one?

I have tried issuing direct powershell commands instead of a ps1 file.
pshell "Get-Host | Select-Object Version"
PSHELL: The library file is missing or specified functions can't be found.

[pshell /s "Get-Host | Select-Object Version"
PSHELL: The library file is missing or specified functions can't be found.

pshell /S "Get-Host | Select-Object Version"
PSHELL: The library file is missing or specified functions can't be found.
 
I don't think you need a profile.ps1.

I get this in PowerShell.

Code:
V:\> Get-Host | Select-Object Version

Version
-------
5.1.19041.1320

And this in TCC

Code:
v:\> pshell /S "Get-Host | Select-Object Version"

Version
-------
1.0.0.3756

I don't know what that means; it may be expected. I'm out of ideas. I suspect @rconn will chime in. He knows a lot more about it than I do.
 
I also get these apparently conflicting results from TCC's PSHELL. They match when run in PowerShell.

Code:
v:\> pshell /S "Get-Host | Select-Object Version"

Version
-------
1.0.0.3756



v:\> pshell /s "$PSVersionTable.PSVersion"

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  1320
 
"PSHELL: The library file is missing or specified functions can't be found."

We solves this by installing the C++ Runtime library v10.
Or copy 'msvcr100.dll' to '..\System32'
 

Similar threads

Back
Top