Jira (BOLT-457) Facter PowerShell task relies on method that is not implemented in all versions of .NET

6 views
Skip to first unread message

James Pogran (JIRA)

unread,
Apr 5, 2018, 2:57:02 PM4/5/18
to puppe...@googlegroups.com
James Pogran created an issue
 
Puppet Task Runner / Bug BOLT-457
Facter PowerShell task relies on method that is not implemented in all versions of .NET
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2018/04/05 11:56 AM
Priority: Normal Normal
Reporter: James Pogran

https://github.com/puppetlabs/bolt/blob/master/modules/facts/tasks/powershell.ps1 uses System.Environment.OSVersion to determine the OS Version of the target node. As explained in https://github.com/PowerShell/PowerShell/issues/2009, .NET Core did not implement this method correctly because the underlying API it calls isn't cross-platform. There is more detail in https://github.com/dotnet/coreclr/pull/6006, with no clear resolution. The result of this is that in .NET Core, the value is either incorrect or returns an error that it isn't implemented. On Windows 10, running under PowerShell Core, it returns 8.1.

Bolt does not use pwsh.exe, it uses powershell.exe, so there is no immediate problem here. However this will be a subtle bug in the future, that won't manifest as an error but as incorrect data instead.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Michael Smith (JIRA)

unread,
Apr 6, 2018, 11:59:02 AM4/6/18
to puppe...@googlegroups.com

Yasmin Rajabi (JIRA)

unread,
Aug 29, 2019, 5:42:02 PM8/29/19
to puppe...@googlegroups.com

Yasmin Rajabi (JIRA)

unread,
Aug 29, 2019, 5:43:03 PM8/29/19
to puppe...@googlegroups.com

Yasmin Rajabi (JIRA)

unread,
Aug 29, 2019, 5:43:05 PM8/29/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages