What is the Script Engine name when debugging

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

What is the Script Engine name when debugging

Post by FrankAndrew »

Product, version and build: PowerShell Studio 2019 5.6.160
32 or 64 bit version of product: 64 bit
Operating system: Windows 7 Enterprise & Windows 10 (1709)
32 or 64 bit OS: 64 bit

With PrimalScript runtime Debugging I can get the ScriptEngine Name by calling:

Code: Select all

Set FSO          = WScript.CreateObject( "Scripting.FileSystemObject" )
ScriptEngineName = FSO.GetBaseName( WScript.FullName )
Is there an equivalent call when in the SAPIEN PowerShell Studio Debugger?
If yes what is the REAL PowerShell Scripting Engine Name?

I Need this functionality do to the fact that some calls in PowerShell either don't work when running in your Debugger or they work differently.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: What is the Script Engine name when debugging

Post by davidc »

PowerShell has a built-in host variable that lets you access the host's name:

Code: Select all

$Host.Name
David
SAPIEN Technologies, Inc.
User avatar
FrankAndrew
Posts: 164
Last visit: Sat Apr 01, 2023 1:52 am

Re: What is the Script Engine name when debugging

Post by FrankAndrew »

Thanks David that is EXACTLY what I was looking for! :D
This topic is 4 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.