none
Windows 10 - Set PS1 association to OPEN with PowerShell but EDIT with PowerShell ISE?

    Question

  • My computer was set to open .PS1 files with Notepad, but in the right-click context menu, I could choose "Edit with Notepad++".

    I changed the OPEN association to PowerShell, but I'd like to change the Edit to PowerShell ISE.

    I've dug through all the default program, default file types, and default protocol associations but can't find the existing one for "Notepad++' or figure out where to create a EDIT new one.

    Anyone know how to configure this?


    There's no place like 127.0.0.1

    Wednesday, April 27, 2016 6:55 PM

Answers

  • Here's what worked for me. It's NOT edit, but it does what i want it to do, opens the file in ISE.

    1. r-click on fu.ps1 file in file explorer
    2. select "open with ..."
    3. select "choose another app"
    4. select "more apps"
    5. scroll way down & select "look for another app on thei PC"
    6. in the dialog that comes up in the directory box (on my machine) insert "C:\Windows\System32\WindowsPowerShell\v1.0\" & push the arrow ->
    7. select powershell_ise.exe
    8. click open

    Now when i r-click on fu.ps1, & select "open with" the sub menu contains:

    • Notepad
    • Windows PowerShell
    • Windows PowerShell ISE  (which opens fu.ps1 in the ISE

    I hope this helps.

    Love and peace,

    Joe Dorocak aka Joe Codeswell

    • Marked as answer by Matt5150 Thursday, May 17, 2018 4:50 PM
    Thursday, May 17, 2018 4:36 PM

All replies

  • This is not a scripting  question.  It is a basic "How do I use Windows" question.

    Right click on file.  Select "Open with" .  Select program and check box "Always open with this program".


    \_(ツ)_/

    Wednesday, April 27, 2016 7:56 PM
    Moderator
  • You are correct.  I asked it here, thinking other PowerShell users might be best to ask.  I will move it to the correct forum.

    I already have "Open With" configured.  It's "Edit With" I am trying to configure.


    There's no place like 127.0.0.1


    • Edited by Matt5150 Wednesday, April 27, 2016 8:42 PM
    Wednesday, April 27, 2016 8:40 PM
  • You are correct.  I asked it here, thinking other PowerShell users might be best to ask.  I will move it to the correct forum.

    I already have "Open With" configured.  It's "Edit With" I am trying to configure.


    There's no place like 127.0.0.1


    Sane thing.

    By default PS1opens with IDE. The edit with was added by notepad++.


    \_(ツ)_/

    Wednesday, April 27, 2016 9:25 PM
    Moderator
  • Are you sure?

    I just imaged a new Windows 10 machine, and by default it opens in notepad and edits in ISE.

    If I change open default to PowerShell, the Edit function in the context menu disappears.

    I want to keep the OPEN default of PowerShell, but set EDIT to ISE.  I swear I had it setup like that in Win7 or 8.1, but I don't recall for sure now.  Maybe it's not possible.


    There's no place like 127.0.0.1

    Thursday, April 28, 2016 12:08 AM
  • Until you installed notepad++

    \_(ツ)_/

    Thursday, April 28, 2016 12:25 AM
    Moderator
  • Until you installed notepad++

    \_(ツ)_/

    This new Windows 10 machine I just imaged to test with, is stock.  It doesn't have Notepad++.

    There's no place like 127.0.0.1

    • Proposed as answer by Elaine JingModerator Thursday, April 28, 2016 6:09 AM
    • Unproposed as answer by Matt5150 Thursday, April 28, 2016 2:50 PM
    Thursday, April 28, 2016 12:29 AM
  • Look here: HKEY_CLASSES_ROOT\Microsoft.PowerShellData.1\shell\edit\command

    Again - this I s n ot a scripting question.


    \_(ツ)_/

    Thursday, April 28, 2016 12:34 AM
    Moderator
  • Hi Matt,

    Thanks for the post, I test the registry jrv provide and it works for me.

    You can have a try and let us know the result.

    Best Regards,

    Elaine


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, April 28, 2016 3:21 AM
    Moderator
  • Look here: HKEY_CLASSES_ROOT\Microsoft.PowerShellData.1\shell\edit\command

    Again - this I s n ot a scripting question.


    \_(ツ)_/

    I rebooted even.  Still same behavior.

    I'd stop replying, but you keep offering solutions!  :P



    There's no place like 127.0.0.1

    Thursday, April 28, 2016 2:50 PM
  • Here's what worked for me. It's NOT edit, but it does what i want it to do, opens the file in ISE.

    1. r-click on fu.ps1 file in file explorer
    2. select "open with ..."
    3. select "choose another app"
    4. select "more apps"
    5. scroll way down & select "look for another app on thei PC"
    6. in the dialog that comes up in the directory box (on my machine) insert "C:\Windows\System32\WindowsPowerShell\v1.0\" & push the arrow ->
    7. select powershell_ise.exe
    8. click open

    Now when i r-click on fu.ps1, & select "open with" the sub menu contains:

    • Notepad
    • Windows PowerShell
    • Windows PowerShell ISE  (which opens fu.ps1 in the ISE

    I hope this helps.

    Love and peace,

    Joe Dorocak aka Joe Codeswell

    • Marked as answer by Matt5150 Thursday, May 17, 2018 4:50 PM
    Thursday, May 17, 2018 4:36 PM
  • Close enough. :)

    I actually abandoned this.  Since I usually needed to open up ISE as Administrator anyway, having the functionality to right-click - Edit in ISE didn't end up having much value.  I thought about finding a way to make it always open as Admin, but decided to peruse more pressing issues. ;)

    Thanks,

    -Matt


    There's no place like 127.0.0.1

    Thursday, May 17, 2018 4:52 PM
  • All you have to do is choose "Open With" - Choose APp - Search for app on this PC and select PowerShell.  This will then be placed permanently into the "Open With" menu.

    \_(ツ)_/

    Thursday, May 17, 2018 5:00 PM
    Moderator