Results 1 to 13 of 13
  1. #1
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post

    Visual Studio 2015: Failed to initialise the PowerShell host on Windows 10

    Hi Folks,

    I am trying to learn how to create a visual studio office addin.

    I tried to create a project for an office addin - understatement of the century.
    no matter what I do - wont budge.

    here are the errors

    2.png


    image1.png



    I have power shell set to unrestricted after trying all other options.

    It is driving me up the wall - what is the problem with visual studio?
    It is one of the reason - I try to avoid visual studio - just can't be dealing with all these issues.


    Any help appreciated -

    I have searched all over for answers -just nothing coming up on google

    thanks

    PB

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    PB,

    I'm not familiar with VS2015 but I downloaded and installed it on my Win 10 Home machine and it came up just fine w/o complaints about Powershell (I have PS set to RemoteSigned). Can you give me the steps you took until you encountered the error?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    PB,

    Ok, I downloaded PowerShell Tools for Visual Studio 2015 and installed the file and was then able to create a PS Project.
    VSPSProject.JPG

    I didn't come across any errors along the way.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Hey Y'all,

    This free Visual Studio w/the PS Tools is pretty neat. It found an error in one of my projects I didn't even know existed. It's fixed now thanks to VS. Looks like I have a new debugging environment for my PS programs may even move development operations there when I get a little more familiarity with the environment.

    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. #5
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post
    Hi RG,


    I have visual studio 2015 community.

    I downloaded the office addin tools for visual studio https://www.visualstudio.com/en-us/f...-tools-vs.aspx

    Then the error came when trying to create a project

    Let me download the link you sent see what comes up

    PB

  6. #6
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post
    Hi RG,

    Downloaded the powershell tools

    same issue as in screen shots

    File > New Project > office /sharepoint > office addin > task pane > Excel,powerpoint, project word checked

    what could it be?

    pb

  7. #7
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post
    Hi,

    I repaired the visual studio 2015.

    Re-downloaded the office developer tools.

    Still same error being generated.

    Powershell host problem.

    Just do not have a clue what to do

    pb

  8. #8
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    PB,

    Ok, it took a little investigating but I got it solved.

    I downloaded and installed the Office addin tools and attempted to create a project as specified:
    VSProject2.PNG

    Look familiar?
    So I checked out the instructions:
    VSProject3.PNG

    Ok so now we have some hunting to do in this unfamiliar environment.
    VSProject4.PNG

    Ah! so we need PowerShell 2.0. Time to Google:

    Found this solution at Stack Overflow.

    Made the change, tried, failed again. Reboot...Success.
    VSProject5.PNG

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  9. #9
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post
    Hello RG,

    thanks for assisting me with this. Still trying to get it to work

    This is what I get fromt the nugent manager

    Code:
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3007) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3014) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3021) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3028) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
    The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3035) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
    The term 'Get-ExecutionPolicy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    Funnily enough my powershell 2.0 was already turned on in programs features.

    Rebooted still no success yet

    pb

  10. #10
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    PB,

    Have you gotten as far as the template in post#8?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  11. #11
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post
    Hi RG,

    unfortunately, when that error comes up - then nothing just the usual start screen that was there at start up.


    The package manager console gives the error shown above.

    I repaired the Visual studio 2015 - so its as good as new install

    I turned on the powershell 2.0

    Do I need to download and install the Powershell 2,0?

    I looked for windows updates nothing



    I'll persevere - we will overcome

    pb

  12. #12
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post
    RG,

    there is no problem with windows Form project.

    That works

    just the office addin that I downloaded and trying to create project with

    pb

  13. #13
    Star Lounger
    Join Date
    Jan 2016
    Posts
    77
    Thanks
    18
    Thanked 1 Time in 1 Post
    Hi folks,

    mini update.

    I copied a script into the config file found here http://stackoverflow.com/questions/1...-windows-8-rtm


    I don't know how it works - or why - but it got rid of the errors from the power shell nugent console thing.

    I was able to open the office addin project now.

    Still seems a bit weird though - shouldn't Microsoft update this naturally - we are on powershell 5.0 - why do i need to go back to 2.0, especially without telling me - the irony ! Just took a whole day of my time and one RG's help in the process

    If problems persist may just completely uninstall and then do a fresh install of the visual 2015.

    for now I'll test it to see how i get on

    thanks RG - keep me updated if there is a better solution to this



    pb


    I am not happy with this powershell 2.0 thing - but have to live with it - if thats what satisfies the nugent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •