Skip to content

Fix ModuleInfoGrouping format#11950

Closed
ThomasNieto wants to merge 2 commits intoPowerShell:masterfrom
ThomasNieto:fix_psedition
Closed

Fix ModuleInfoGrouping format#11950
ThomasNieto wants to merge 2 commits intoPowerShell:masterfrom
ThomasNieto:fix_psedition

Conversation

@ThomasNieto
Copy link
Copy Markdown
Contributor

@ThomasNieto ThomasNieto commented Feb 25, 2020

PR Summary

This PR updates the PSEdition column in the Module table format to check PrivateData.PSData.Tags for PSEdition_Desktop and PSEdition_Core if CompatiblePSEditions is not defined. This allows module authors to indicate compatible PSEditions without limiting module compatibility to 5.1+ by using CompatiblePSEditions.

If CompatiblePSEditions or tags are not for a module in $PSHOME it will add Core and if the module is in Windows in-box it will add Desktop.

# Current
PS C:\> Get-Module -ListAvailable | Where-Object Name -eq Pester | Select-Object -First 1


    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     4.9.0                 Pester                              Desk      {Describe, Context, It, Should…}


# New
PS C:\> Get-Module -ListAvailable | Where-Object Name -eq Pester | Select-Object -First 1


    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     4.9.0                 Pester                              Core,Desk {Describe, Context, It, Should…}

PR Context

This PR fixes #11927 and #7856

PR Checklist

@ghost ghost assigned TravisEz13 Feb 25, 2020
@iSazonov
Copy link
Copy Markdown
Collaborator

@ThomasNieto #11927 and #7856 is issues with conclusions. It seems the PR fixes only #7856.

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Feb 25, 2020
@iSazonov iSazonov added this to the 7.1.0-preview.1 milestone Feb 25, 2020
@ThomasNieto
Copy link
Copy Markdown
Contributor Author

@iSazonov the newest commit adds logic for modules in $PSHOME and Windows PowerShell in-box.

@iSazonov
Copy link
Copy Markdown
Collaborator

I'd expect that core modules is fixed in its manifests.

@ThomasNieto
Copy link
Copy Markdown
Contributor Author

@iSazonov have any idea why CodeFactor failed? How do I get it to retry?

@iSazonov
Copy link
Copy Markdown
Collaborator

iSazonov commented Feb 26, 2020

CodeFactor CI is not mandatory. We use it as temporary recommendations.

{
$editions = @(($_.PrivateData.PSData.Tags | Where-Object {$_ -like 'PSEdition_*'}) -replace 'PSEdition_', '')
}
elseif ($_.ModuleBase -like '{0}*' -f $PSHOME) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elseif ($_.ModuleBase -like '{0}*' -f $PSHOME) {
elseif ($_.ModuleBase -like ""$PSHOME*"") {

$editions = @('Core')
}
elseif ($IsWindows -and
$_.ModuleBase -like '{0}\Windows\system32\WindowsPowerShell\v1.0\Modules' -f $Env:SystemDrive ) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$_.ModuleBase -like '{0}\Windows\system32\WindowsPowerShell\v1.0\Modules' -f $Env:SystemDrive ) {
$_.ModuleBase -like ""$Env:SystemDrive\Windows\system32\WindowsPowerShell\v1.0\Modules"") {

@daxian-dbw
Copy link
Copy Markdown
Member

The changes in this PR conflicts with the effort in #11943, which tries to make the module formatting script work in strict mode.
If this is the right fix, then the code needs to be updated to work in strict mode.

@iSazonov
Copy link
Copy Markdown
Collaborator

iSazonov commented May 8, 2020

@ThomasNieto Could you please address latest comments?

@ghost ghost added the Review - Needed The PR is being reviewed label May 27, 2020
@ghost
Copy link
Copy Markdown

ghost commented May 27, 2020

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Mainainer, Please provide feedback and/or mark it as Waiting on Author

Copy link
Copy Markdown
Member

@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address @daxian-dbw comments

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label May 27, 2020
@ghost ghost removed this from the 7.1.0-preview.4 milestone May 27, 2020
@TravisEz13 TravisEz13 removed the Review - Needed The PR is being reviewed label May 27, 2020
@ghost ghost added the Stale label Jun 11, 2020
@ghost
Copy link
Copy Markdown

ghost commented Jun 11, 2020

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

@ghost ghost closed this Jun 22, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Stale Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[7.0.0-rc.3] Some modules installed with PowerShell 7 are still marked "Desktop" only

4 participants