Please offer a working solution to NOT associate PowerShell Source files (e.g. ps1)

Use this forum to ask questions before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
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.
Posts: 1
Joined: Mon May 20, 2019 10:10 pm

Please offer a working solution to NOT associate PowerShell Source files (e.g. ps1)

Post by KlaudiaThalberg » Mon May 20, 2019 3:43 pm

Good evening

We're evaluating Sapien PowerShell Studio and it's very annyoing that it is associating common PowerShell Script file types to the Sapien PowerShell Studio.
The reason is obvious: we develop PowerShell Script to use them. If we doubleclick a Script, then it must be executed in the vast majority of cases and not edited.

It's a shame that Sapien does not offer to disable the kidnapping of the common script file type allocation - we guess that we talk about a professional IDE and it's not that hard to add this customization to the setup procedure (and to not overwrite it on later updates ;-))

Other Users have reported the same problem, for example: viewtopic.php?f=12&t=13859&sid=6ec3a39b ... 8b51af1983

Your supporter proposed a "solution" which is just a very unprofessional, annoying workaround: it's usually a bad idea to create an unwanted system state and fix it afterward if it can be prevented right from the start.
Additionally, the workaround does not work at all on our computers, as the original poster already has explained. Even if your supporter wrote that he had tested it, it's obvious that the workaround does not always work and must be fixed after each Sapien Update :-(

Yes, it is really annoying for a commercial product that your customers have to discuss such trivial and easy to implement 'features'. If it's too hard for Sapien to modify the Setup, then you can find a working and final workaround on the other thread: you're setup must just add 3 lines of code and it would be nice if you could add a Reg-File so that the 'disable file association' registry key can be set by a double click.

Do you have any plans to fix it?

Thanks a lot!, all the best,

User avatar
Site Admin
Posts: 62
Joined: Thu Jun 01, 2017 7:20 am

Re: Please offer a working solution to NOT associate PowerShell Source files (e.g. ps1)

Post by brittneyr » Mon May 20, 2019 8:34 pm

I will let the engineering team know about the problems you are having, and we will get back to you soon.
Brittney Ryn
SAPIEN Technologies, Inc.

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

Re: Please offer a working solution to NOT associate PowerShell Source files (e.g. ps1)

Post by Alexander Riedel » Mon May 20, 2019 10:26 pm

A review from the product team notwithstanding, let me weigh in here with some thoughts.

We are not actually 'kidnapping' an association. The 'open' verb, which is the OS default action on any file, is associated to open a powershell script in Notepad. This is done intentionally by Microsoft to prevent unwanted execution of potentially harmful administrative scripts. On a system configured with 'Single click to open' simply clicking on a powershell script would execute it. I don't know if you remember the "I love you" virus, but that was spread far and wide in exactly that way, because the default 'open' action for VBScript files was to run them.

As it is, opening a PowerShell script in Notepad is quite useless in most cases, so it has become fair game for most vendors to re-associate the open verb with themselves.
To give a counterpoint, PrimalScript, our other, more general scripting IDE, does not associate the 'open' verb with itself but rather uses an "Open with PrimalScript' association. As you may guess, over the years a number of people have complained that simply double clicking a file does not open it to edit. That's just to show there is no right way to do this.

Now, it is not for me to tell you what to do on your systems and your security issues are your own, but my suggestion to you (and anyone else reading this) is to leave the 'open' verb for PowerShell scripts associated with *any* editor, just don't set it to simply execute it. Add a right click menu item for Windows File Explorer to 'Run with PowerShell' instead. It's not really less convenient but requires more of a conscious action to execute that script. If you are at it, add a 'Run elevated with PowerShell' as well.

There are a good number of articles already out there describing this and discussing pros and cons, so I won't reiterate them here, but feel free to ask if you want me to point you to one that works.
Alexander Riedel
SAPIEN Technologies, Inc.