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

    Home » Forums » Developers, developers, developers » DevOps Lounge » Visual Studio 2015: Failed to initialise the PowerShell host on Windows 10

    Author
    Topic
    #504519

    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:mad:.
    no matter what I do – wont budge.

    here are the errors

    43605-2

    43606-image1

    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

    Viewing 10 reply threads
    Author
    Replies
    • #1552108

      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? :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1552109

      PB,

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

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

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1552111

      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.

      :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1552173

      Hi RG,

      I have visual studio 2015 community.

      I downloaded the office addin tools for visual studio https://www.visualstudio.com/en-us/features/office-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

    • #1552174

      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

      • #1552212

        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

    • #1552217

      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:
      43611-VSProject2

      Look familiar?
      So I checked out the instructions:
      43612-VSProject3

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

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

      Found this solution at Stack Overflow.

      Made the change, tried, failed again. Reboot…Success.
      43614-VSProject5

      HTH :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1552220

      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:WindowsSysWOW64WindowsPowerShellv1.0types.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:WindowsSysWOW64WindowsPowerShellv1.0types.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:WindowsSysWOW64WindowsPowerShellv1.0types.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:WindowsSysWOW64WindowsPowerShellv1.0types.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:WindowsSysWOW64WindowsPowerShellv1.0types.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

    • #1552230

      PB,

      Have you gotten as far as the template in post#8? :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1552231

      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

    • #1552235

      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

    • #1552240

      Hi folks,

      mini update.

      I copied a script into the config file found here http://stackoverflow.com/questions/12638289/embedding-powershell-v2-0-in-net-app-on-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:mad:, 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.

    Viewing 10 reply threads
    Reply To: Visual Studio 2015: Failed to initialise the PowerShell host on Windows 10

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: