Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a module manifest #242

Merged
merged 3 commits into from
Feb 9, 2016
Merged

Add a module manifest #242

merged 3 commits into from
Feb 9, 2016

Conversation

theaquamarine
Copy link
Collaborator

Providing a manifest should prevent any issues with exports occurring in the future. This will use the exports specified in posh-git.psm1 as discussed in #207, which should fix #224.

@svmastersamurai
Copy link

👍 Would love to get my team on this module without having to make modifications manually :)

@dahlbyk
Copy link
Owner

dahlbyk commented Feb 9, 2016

Binary file not shown.

It's likely the manifest is encoded as UTF-16. Can you reencode as UTF-8 so we can see the diff?

@theaquamarine
Copy link
Collaborator Author

Done. Thanks, Visual Studio!

dahlbyk added a commit that referenced this pull request Feb 9, 2016
@dahlbyk dahlbyk merged commit f71b636 into dahlbyk:master Feb 9, 2016
@dahlbyk
Copy link
Owner

dahlbyk commented Feb 9, 2016

@shiftkey
Copy link
Contributor

shiftkey commented Mar 2, 2016

Just a heads up - this change makes Posh-Git incompatible with users who are still running PowerShell v2 - RootModule is v3-specific, but also required to make it function as expected.

Was this intentional? Would you like me to log an issue about it?

@haacked
Copy link
Contributor

haacked commented Mar 2, 2016

Hmm, based on #186 it looks like this was intentional. 😢

@dahlbyk
Copy link
Owner

dahlbyk commented Mar 3, 2016

Also: #163

@shiftkey @haacked do you have a sense how many GitHub Desktop users are still on PowerShell 2.0? PowerShell 3 has been out for 3.5 years now. 😦

@haacked
Copy link
Contributor

haacked commented Mar 3, 2016

@shiftkey @haacked do you have a sense how many GitHub Desktop users are still on PowerShell 2.0? PowerShell 3 has been out for 3.5 years now.

Unfortunately this is not something we directly track today.

What we do know is that half of our users are on Windows 7, which comes with PowerShell 2.0 by default. I don't think Windows Update upgrades PowerShell, does it? So I have to assume that most people on Win7 are still on PS 2.0 because people never upgrade. http://blog.codinghorror.com/the-power-of-defaults/

@dahlbyk
Copy link
Owner

dahlbyk commented Mar 3, 2016

That would be useful telemetry to have!

If deprecating PS 2.0 is premature for your uses, we'll need to come up with a plan to not hold back the project (more than my neglect is already 👿) while preserving what support we can going forward.


So @shiftkey what exactly is the problem with adding this psd1?

@shiftkey
Copy link
Contributor

shiftkey commented Mar 3, 2016

@dahlbyk the error message you see when launching Posh Git under PowerShell v2 kinda sums it up:

Import-Module : The 'C:\path\to\posh-git.psd1' module cannot be imported because its manifest contains one or more members that are not valid. The valid manifest members are ('ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'PowerShellVersion', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchitecture', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'ModuleList', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport'). Remove the members that are not valid ('RootModule'), then try to import the module again.

However you cannot just remove RootModule as other parts of the module seem to depend on this.

@dahlbyk
Copy link
Owner

dahlbyk commented Mar 3, 2016

Can you Import-Module C:\path\to\posh-git.psm1 directly instead?

@theaquamarine theaquamarine deleted the manifest branch March 5, 2016 11:30
@theaquamarine
Copy link
Collaborator Author

RootModule is an alias for ModuleToProcess which existed in v2, so switching to that will function identically in v3+ and work in v2, Swapping seems an easy solution, since we gain nothing breaking compatibility here.
https://technet.microsoft.com/en-gb/library/hh849709.aspx

theaquamarine added a commit to theaquamarine/posh-git that referenced this pull request Mar 5, 2016
The RootModule key was renamed from ModuleToProcess in PowerShell v3
so is not compatible with PowerShell v2. ModuleToProcess still exists
as an alias, so use that instead.

See discussion in dahlbyk#242
@shiftkey
Copy link
Contributor

shiftkey commented Mar 7, 2016

Can you Import-Module C:\path\to\posh-git.psm1 directly instead?

No errors reported against master, but the prompt isn't enhanced either:

PS C:\Users\shiftkey\Documents\GitHub\posh-git> Import-Module .\posh-git.psm1
WARNING: posh-git support for PowerShell 2.0 is deprecated; you have version 2.0.
To download version 3.0, please visit https://www.microsoft.com/en-us/download/details.aspx?id=34595
For more information and to discuss this, please visit https://github.com/dahlbyk/posh-git/issues/163
To suppress this warning, change your profile to include 'Import-Module posh-git -Args $true'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start-SSHAgent missing in v0.5.0.2015
5 participants