Unable to run any script files from the script pane

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 6 years and 10 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
barnold08
Posts: 22
Last visit: Fri Sep 02, 2022 11:36 am

Unable to run any script files from the script pane

Post by barnold08 »

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: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

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

Post by davidc »

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?
  1. 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: 22
Last visit: Fri Sep 02, 2022 11:36 am

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

Post by barnold08 »

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: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

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

Post by davidc »

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: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

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

Post by Alexander Riedel »

Have you checked your local execution policy or that set by group policy?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
barnold08
Posts: 22
Last visit: Fri Sep 02, 2022 11:36 am

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

Post by barnold08 »

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: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

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

Post by davidc »

Thank you for the update.
David
SAPIEN Technologies, Inc.
This topic is 6 years and 10 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.