What's the simplest way to launch a new script in PSS?

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 7 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
yobyot
Posts: 40
Last visit: Tue Jun 02, 2020 3:09 pm

What's the simplest way to launch a new script in PSS?

Post by yobyot »

Product, version and build: PS 2016
32 or 64 bit version of product: 64-bit
Operating system: Win10
32 or 64 bit OS: 64-bit
PowerShell Version: 5.2.120

I have a simple question: when I want to just run cmdlets in PSS -- not necessarily work on a large PowerShell script -- I can either use the console, which I don't like, or use the editor. To use the editor, I have to click File, New and if I have templates, I have to select one. Then, I can enter my PowerShell but to run it, but I have to save it to disk first.

Is there any way to get PSS to work more like the ISE? There, I can just start the ISE, hit Ctrl-n, enter some PowerShell and hit F5 to run it. I'd like to be able to do that -- or the equivalent -- with PSS. IOW, I'd like to be able to launch PSS, use a keyboard shortcut to create a new file, enter something simple -- say a get-process -- and hit F5 to run it.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: What's the simplest way to launch a new script in PSS?

Post by davidc »

Ctrl + N will open a new script in PowerShell Studio.
The reason PowerShell Studio saves the script is because it needs to submit the file to the PowerShell Engine and you want to makes sure the file is present and up to date.

As for running a selection, you will want to use the Run Selection command [Ctrl + F8] instead of Run [Ctrl + F5].

PowerShell Studio uses a clean runspace to execute the script / selection every time. To maintain a persistent runspace, use the Run Selection in Console [Ctrl + Shift + F8] command instead.


David
David
SAPIEN Technologies, Inc.
User avatar
yobyot
Posts: 40
Last visit: Tue Jun 02, 2020 3:09 pm

Re: What's the simplest way to launch a new script in PSS?

Post by yobyot »

How do I avoid the template selection when I hit Ctrl-N?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: What's the simplest way to launch a new script in PSS?

Post by davidc »

If you created a custom template, it will always pop up. At the moment there is no way around this other than removing the original template or the custom template.

David
David
SAPIEN Technologies, Inc.
User avatar
yobyot
Posts: 40
Last visit: Tue Jun 02, 2020 3:09 pm

Re: What's the simplest way to launch a new script in PSS?

Post by yobyot »

FWIW, it would be nice to have a "quick start" mode for PSS. Word, Excel, the ISE -- all of them come up "ready to use" PSS doesn't.
User avatar
yobyot
Posts: 40
Last visit: Tue Jun 02, 2020 3:09 pm

Re: What's the simplest way to launch a new script in PSS?

Post by yobyot »

Also, is it possible to delete or alter the contents of the default template? It's annoying and, other than userid/organization in the general settings, I don't see how to modify either the layout or the contents of the default template used when a new script is created.
User avatar
yobyot
Posts: 40
Last visit: Tue Jun 02, 2020 3:09 pm

Re: What's the simplest way to launch a new script in PSS?

Post by yobyot »

Bump for answer to last question.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: What's the simplest way to launch a new script in PSS?

Post by davidc »

Please try the latest build of PowerShell Studio (v5.2.121). If you create a user template that has the same name as the built-in template, it will override that template.

David
David
SAPIEN Technologies, Inc.
User avatar
yobyot
Posts: 40
Last visit: Tue Jun 02, 2020 3:09 pm

Re: What's the simplest way to launch a new script in PSS?

Post by yobyot »

OK, that works.

But would it have killed you to indicate that the name of the name of the builtin template is 'PowerShell Studio Template' and it has to be located in Templates/File Types? Or doc it (along with the rest of this impressive product whose complete functionality I can only guess at due to the mess that passes for documentation) in something other than a hard-to-decipher release note?

Every time I post here, I feel like a) you guys think PSS is perfect just the way it is b) you give me info I didn't ask for as if it's relevant to the question I answered (see above about Run Selection which has nothing to do with my question) and c) your answers, when I get them, are cryptic and grudging.

It's like you guys want to hear only from your fans and other true believers. Well, I am a fan (and a beginner) and I'm here to tell you the product is good but far from perfect. And, as I said before, the doc is a disaster.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: What's the simplest way to launch a new script in PSS?

Post by davidc »

You are correct; I should have mentioned the template name. I assumed you were aware of the name because the built-in template (PowerShell Studio Template) appears in the list, after creating your own custom template.

I'm not sure why you have the impression that we assume everything is perfect. We frequently change and update the product in response to user feedback. We take your feedback seriously because it is what allows us to create a better product. We are all human and at times we misinterpret comments and questions. If this is ever the case, just let us know, so that we can get you the answers you seek.
If there is a feature you wish to see, please feel free to post on our Wish List Feature Request forum:

viewtopic.php?f=9&t=10082

In regards to Run Selection, I suggested the command because it allows you to run code without saving:
Then, I can enter my PowerShell but to run it, but I have to save it to disk first.
David
David
SAPIEN Technologies, Inc.
This topic is 7 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.