Unable to run any script files from the script pane

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.
User avatar
barnold08
Posts: 16
Joined: Fri Jun 19, 2015 1:50 pm

Unable to run any script files from the script pane

Post by barnold08 » Fri May 19, 2017 2:11 pm

Product, version and build: 4.5.149
(*** Please do not write "latest" as a version, specify a version number ***)
32 or 64 bit version of product: x64
Operating system: Windows 10 1607
32 or 64 bit OS: x64
PowerShell Version: 5.1.14393.1066
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

Hello,
I'm not sure what I did, but any script I to try to run in Powershell Studio from the script editor the output says "The term '%scriptfullname% is not recognized as the name of a cmdlet, function, script file, or operable program..." and says "ObjectNotFound: (%Scriptfullname%) [], CommandNotFoundException". Un/Reinstalling Powershell Studio, that didn't fix it. I do not have this problem in Powershell ISE. Does anyone have any ideas how I can fix this? Thanks in advance!

User avatar
davidc
Posts: 4813
Joined: Thu Aug 18, 2011 4:56 am

Re: Unable to run any script files from the script pane

Post by davidc » Fri May 19, 2017 5:37 pm

I don't believe I have seen this before. If you can, please answer the following question:

1. What platform settings are you uses? PowerShell V5 or V2? STA Mode? 64 Bit or 32 bit? etc.
2. If you create a new ps1 script with the following command, do you still get the error?

Code: Select all

Write-Host 'Hello World'
3. Do you get the error if you use Run selection?
4. Does the error include a line number?

Thank you,
David
SAPIEN Technologies, Inc.

User avatar
barnold08
Posts: 16
Joined: Fri Jun 19, 2015 1:50 pm

Re: Unable to run any script files from the script pane

Post by barnold08 » Mon May 22, 2017 5:47 am

Thank you for the response! Great minds think a like... I previously created a script file called "Hello-World.ps1" and the only line in the file is "Write-Host "Hello World!"". Here is the output:

>> Running (Hello-World1.ps1) Script...
>> Platform: V5 64Bit (STA)
ERROR: C:\Temp\Hello-World1.ps1 : The term 'C:\Temp\Hello-World1.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
ERROR: the spelling of the name, or if a path was included, verify that the path is correct and try again.
line (1, 1): ERROR: At Line: 1 char: 1
ERROR: + C:\Temp\Hello-World1.ps1
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : ObjectNotFound: (C:\Temp\Hello-World1.ps1:String) [], CommandNotFoundException
ERROR: + FullyQualifiedErrorId : CommandNotFoundException
ERROR:

>> Execution time: < 1 second
>> Script Ended

Any Thoughts? I'm sure it's something dumb I did on accident...

User avatar
davidc
Posts: 4813
Joined: Thu Aug 18, 2011 4:56 am

Re: Unable to run any script files from the script pane

Post by davidc » Tue May 30, 2017 8:29 am

Can you try running the same script using PrimalScript? This will let us know if the issue is within the PowerShell Studio UI or the engine itself.

You can download a trial from the product page:

https://www.sapien.com/software/primalscript

In addition, have you tested this on a different machine within your network?
David
SAPIEN Technologies, Inc.

User avatar
Alexander Riedel
Posts: 6188
Joined: Tue May 29, 2007 4:43 pm

Re: Unable to run any script files from the script pane

Post by Alexander Riedel » Tue May 30, 2017 9:33 am

Have you checked your local execution policy or that set by group policy?
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
barnold08
Posts: 16
Joined: Fri Jun 19, 2015 1:50 pm

Re: Unable to run any script files from the script pane

Post by barnold08 » Wed May 31, 2017 8:44 am

Thank you for the replies, I have figured out the culprit. The execution policy set by Group Policy got me thinking and, as expected, it was completely self-inflicted. We have an AppLocker GPO linked that only included the default rules for running scripts (allow anything ran from Program Files, allow anything ran from Windows, and allow Admins to run anything from anywhere)... which was blocking my script execution from C:\Temp.

Thanks again for the help!

User avatar
davidc
Posts: 4813
Joined: Thu Aug 18, 2011 4:56 am

Re: Unable to run any script files from the script pane

Post by davidc » Wed May 31, 2017 10:50 am

Thank you for the update.
David
SAPIEN Technologies, Inc.