PowerShell is not detected in Server Core

Hi, I’m getting the following error:

Windows PowerShell 2.0 or above does not appear to be installed on this machine.

running Tools.exe (2.0.8.977) on Windows Server 2012 R2 Core having PowerShell 4.0 installed.

Thanks for getting in touch. We check the registry:

“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell”

Looking for the “1” or “3” subkeys, either of which we expect to contain an “Install” value > 0.

Can you please let me know what subkeys are presented under the PowerShell registry key on your configuration?

Thanks,
Nick

On 2012 R2 Core:

@@@
[deploy]: PS C:> Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1 -Name Install
Get-ItemProperty : Property Install does not exist at path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1.
@@@
and
@@@
[deploy]: PS C:> Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3 -Name Install
Install : 1
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell
PSChildName : 3
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
@@@

The same for 2012 R2 with GUI.

Here’s some OS details:

@@@
[deploy]: PS C:> GeT-WmiObject Win32_OperatingSystem
SystemDirectory : C:\Windows\system32
BuildNumber : 9600
RegisteredUser : Windows User
Version : 6.3.9600
@@@

Thanks, this looks like it will need a bit more investigation on our end.

Forgive my lack of understanding of the 2012 R2 configurations, but isn’t Core a non-GUI configuration? The Tools.exe that we ship is a GUI app, so I can’t imagine it will run on Core.

Another approach, if you’re blocked, might be to do whatever configuration you want to do with Tools.exe on a full GUI instance with Octopus Server, but instead of making changes, use the “Show script” option to copy PowerShell that you can then run on Core directly.

Hope this helps/makes sense!

Nick

Sorry for a late response.
Despite it’s Core Mode you can run GUI apps still, you need to login over RDP.
Many of them work, like Windows Installer. Or initial Server/Tentacle setup app, it works too.

Thanks for the follow-up. I’ve created a bug to track this here: https://github.com/OctopusDeploy/Issues/issues/489

Regards,
Nick

Thanks. But I see it was closed. Was it resolved?

Yes, though it is not available in a public build yet. 2.0.10 will have this.

Instead of sniffing the registry we’ll now simply try to run some PowerShell at startup to determine the version - hopefully more resilient to PowerShell configuration changes.

Cheers,
Nick

Can you please share an approximate date of the next release?

And looks like this is not an issue of Core mode but PSh4-only.
I installed GUI on the server to configure a tentacle but manager doesn’t work still.

Hi - we’ll have a new RC with this fix out in the coming week.

Regards,
Nick

Get it while it’s hot! :slight_smile:

Awesome! Thanks. Everything works as expected.

Hi Alexander,

Shortly after releasing 2.0.10.1059 we found a critical bug in Active Directory authentication; if you’re using AD in your environment, upgrading to the newer 2.0.10.1066 is advised.

Apologies for any inconvenience,
Nick

I just upgrade my deploy server to 2.1.3.1223.

I am running server 2008 R2 SP1 with PowerShell 3.0 (per ps script to check).

I get the “Windows Powershell 2.0 must be installed” . The installer is completely happy, but the Octopus Tenacle Manager is not"

I looked at the powershell keys, have the 1 & 3 and both have install = 1 for both.

Thanks for the Skype call to debug this David.

When checking whether PowerShell is installed, we now simply call PowerShell.exe. But for some reason on David’s machine PowerShell wasn’t in the PATH environment variable, so running PowerShell.exe from a command prompt didn’t work. Adding it to the path resolved the issue.

Ok. Spoke with Paul. Many kudos for some of the most excellent service that I have ever had with a software vendor.d.

Thank your the expedient help.

Hi,
After installing 2.6 I’m getting the same error:

PowerShell 2.0 or above does not appear to be installed

However nothing was changed since installation of 2.5.x. I have both PowerShell v2 and v4 installed. C:\Windows\System32\WindowsPowerShell\v1.0\ is in %PATH%. $PSVersionTable returns PSVersion=4.0.

Hmm. Strange. Rebooting helped. Sorry for alarming.

Hi,

This issue is happening for me. I have installed the lastest version of Ocotpus deploy 3.4.13 and have powershell 4 installed and referenced correctly in PATH.

What should i do?