[JIRA] (JENKINS-52421) Support PowerShell Core on Nano Server

3 views
Skip to first unread message

st.stanie@hotmail.com (JIRA)

unread,
Jul 8, 2018, 10:39:02 AM7/8/18
to jenkinsc...@googlegroups.com
Stan Wijckmans updated an issue
 
Jenkins / Improvement JENKINS-52421
Support PowerShell Core on Nano Server
Change By: Stan Wijckmans
Summary: Support PowersShell PowerShell Core on Nano Server
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

st.stanie@hotmail.com (JIRA)

unread,
Jul 8, 2018, 10:40:01 AM7/8/18
to jenkinsc...@googlegroups.com
Stan Wijckmans updated an issue
When the plugin detects "not unix" it will try to start powershell.exe. On Windows Nano Server there is only PowerShell Core available and the executable name there is pwsh.exe. Creating a hardlink or symlink named powershell.exe that links to pwsh.exe does not work because when you run powershell.exe (the link) the process exits with the message:

{{ The managed DLL bound to this executable: 'pwsh.dll', did not match own name 'powershell.dll'. }}
{{ A fatal error was encountered. This executable was not bound to load a managed DLL. }}

This makes it currently impossible to use PS Core on Nano Server.

One simple solution would be to detect Nano Server and then just run pwsh.exe lust like on unix systems.


When running Windows Server Core this gets a little more complicated because you can have both the regular PS and PS Core side by side, so a decision must be made about the behavior in this case.
The options are:
* If pwsh.exe is in PATH then always prefer it over the regular one
* If regular powershell.exe is available then always prefer it over PS Core

The first option makes the most sense to me because having both PS versions is not likely to happen and if you have them running side by side that's probably because you want PS Core to be used (if you want regular PS then just don't install PS Core in the first place).

st.stanie@hotmail.com (JIRA)

unread,
Jul 8, 2018, 10:40:02 AM7/8/18
to jenkinsc...@googlegroups.com
Stan Wijckmans updated an issue
When the plugin detects "not unix" it will try to start powershell.exe. On Windows Nano Server there is only PowerShell Core available and the executable name there is pwsh.exe. Creating a hardlink or symlink named powershell.exe that links to pwsh.exe does not work because when you run powershell.exe (the link) the process exits with the message:

{ quote} { { The managed DLL bound to this executable: 'pwsh.dll', did not match own name 'powershell.dll'.}}
{{ A fatal error was encountered. This executable was not bound to load a managed DLL.

{quote
} }

This makes it currently impossible to use PS Core on Nano Server.

One simple solution would be to detect Nano Server and then just run pwsh.exe lust like on unix systems.

When running Windows Server Core this gets a little more complicated because you can have both the regular PS and PS Core side by side, so a decision must be made about the behavior in this case.
The options are:
* If pwsh.exe is in PATH then always prefer it over the regular one
* If regular powershell.exe is available then always prefer it over PS Core

The first option makes the most sense to me because having both PS versions is not likely to happen and if you have them running side by side that's probably because you want PS Core to be used (if you want regular PS then just don't install PS Core in the first place).

st.stanie@hotmail.com (JIRA)

unread,
Jul 8, 2018, 10:41:02 AM7/8/18
to jenkinsc...@googlegroups.com
Stan Wijckmans updated an issue
When the plugin detects "not unix Unix " it will try to start powershell.exe. On Windows Nano Server there is only PowerShell Core available and the executable name there is pwsh.exe. Creating a hardlink or symlink named powershell.exe that links to pwsh.exe does not work because when you run powershell.exe (the link) the process exits with the message:

{quote}{{The managed DLL bound to this executable: 'pwsh.dll', did not match own name 'powershell.dll'.}}
A fatal error was encountered. This executable was not bound to load a managed DLL.
{quote}
This makes it currently impossible to use PS Core on Nano Server.

One simple solution would be to detect Nano Server and then just run pwsh.exe lust like on unix Unix systems.


When running Windows Server Core this gets a little more complicated because you can have both the regular PS and PS Core side by side, so a decision must be made about the behavior in this case.
The options are:
* If pwsh.exe is in PATH then always prefer it over the regular one
* If regular powershell.exe is available then always prefer it over PS Core

The first option makes the most sense to me because having both PS versions is not likely to happen and if you have them running side by side that's probably because you want PS Core to be used (if you want regular PS then just don't install PS Core in the first place).

esrahofstede@outlook.com (JIRA)

unread,
Jan 19, 2019, 2:35:02 AM1/19/19
to jenkinsc...@googlegroups.com
esra hofstede updated an issue
Change By: esra hofstede
Component/s: powershell-plugin
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

esrahofstede@outlook.com (JIRA)

unread,
Mar 23, 2019, 2:21:02 PM3/23/19
to jenkinsc...@googlegroups.com
esra hofstede commented on Improvement JENKINS-52421
 
Re: Support PowerShell Core on Nano Server

Are there any updates on this?

lordhomer@outlook.com (JIRA)

unread,
Apr 16, 2020, 3:55:03 AM4/16/20
to jenkinsc...@googlegroups.com
Martin Bauer updated an issue
 
Change By: Martin Bauer
Priority: Minor Major
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

lordhomer@outlook.com (JIRA)

unread,
Apr 16, 2020, 4:00:03 AM4/16/20
to jenkinsc...@googlegroups.com
Martin Bauer commented on Improvement JENKINS-52421
 
Re: Support PowerShell Core on Nano Server

The problem is a general one on Windows platforms.

Currently it is not possible to use Powershell Core (currently version 6 and 7) with the Jenkins plugin on Windows machines.
The version 5.1 (integrated in Windows) is always used. But this version is no longer developed and scripts may require newer versions of PS.

There should be a possibility to use pwsh instead of powershell on Windows systems.

The best would be to have two Build-Steps provided from the Plug-in on Windows Systems:
Powershell
and Powershell Core 

Reply all
Reply to author
Forward
0 new messages