How to install a add-on into ISE?

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Gary Pietila Gary Pietila 3 years, 10 months ago.

  • Author
    Posts
  • #9602
    Profile photo of Gary Pietila
    Gary Pietila
    Participant

    Hi all,

    I am trying to figure out how to install Doug Finke's PSharp add-on into PS ISE.

    I downloaded the zip file from github & it contains a number of .ps1 files in a couple of different directories. Tried adding just the psharp.ps1 file contents to the end of my Microsoft.PowerShellISE_profile.ps1 file & it did add PSharp to the add-on's drop down menu but it also threw a bunch of errors in the console window when I opened ISE. Do i need to add the contents of the other 12 .ps1 files to my ISE profile?

    Any tips/advice would be most appreciated.

  • #9603
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    It looks like as long as ConvertTo-PSCustomObject.ps1 , Edit-Live.ps1, and New-FunctionFromSelectedText.ps1 are in the same directory as your profile script, what you did should work okay. The first few lines of psharp.ps1 try to dot source those scripts from its current directory. Rather than copying the contents of psharp.ps1 into your profile, though, you should probably just dot source it. That way you can download updates without having to recopy it into your profile.

    # Microsoft.PowerShellISE_profile.ps1
    . C:\Path\To\psharp.ps1
    

    I'm not sure what the purpose is for the other ps1 scripts in the "spike" folder of the git repository. They don't seem to be used right now.

  • #9609
    Profile photo of Gary Pietila
    Gary Pietila
    Participant

    Dave,

    Thank you for the info, works like a charm!

You must be logged in to reply to this topic.