What is the Script Engine name when debugging

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
User avatar
FrankAndrew
Posts: 119
Joined: Thu Oct 26, 2006 7:00 pm

What is the Script Engine name when debugging

Post by FrankAndrew » Tue Apr 23, 2019 1:19 am

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
Joined: Thu Aug 18, 2011 4:56 am

Re: What is the Script Engine name when debugging

Post by davidc » Tue Apr 23, 2019 7:21 am

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: 119
Joined: Thu Oct 26, 2006 7:00 pm

Re: What is the Script Engine name when debugging

Post by FrankAndrew » Tue Apr 23, 2019 12:56 pm

Thanks David that is EXACTLY what I was looking for! :D