-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Warn of PowerShell 2.0 deprecation #186
Conversation
if (Get-Module posh-git) { return } | ||
|
||
if ($PSVersionTable.PSVersion.Major -lt 3 -and !$NoVersionWarn) { | ||
Write-Warning ("posh-git support for PowerShell 2.0 is deprecated; you have version $($Host.Version).`n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use $($PSVersionTable.PSVersion)
instead of $($Host.Version)
, since the latter will only match for the standard host (not in the NuGet console, for example).
So sorry for the delay in looking at this. Looks great other than my comment on |
@@ -30,7 +30,7 @@ Install-Module posh-git | |||
Installing (manual) | |||
------------------- | |||
|
|||
0. Verify you have PowerShell 2.0 or better with $PSVersionTable.PSVersion | |||
0. Verify you have PowerShell 2.0 or better with `$PSVersionTable.PSVersion`. PowerShell 3.0 is preferred as 2.0 support is deprecated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bah, I think I just merged a conflict (#171).
Allow Powershell 2 support deprecation warning to be suppressed by importing the module with a true value as an argument. The ability to pass arguments through Import-Module is pretty limited, accepting only positional arguments, but it still seems a preferable option to environment variables or asking users to modify posh-git directly. Closes dahlbyk#163
Version check fixed, conflict fixed. |
Warn of PowerShell 2.0 deprecation
Perfect, thanks! |
Solve the problem of warning, can modified first line of the posh-git.psm1: |
Rather than modify the module, I would suggest updating Import-Module .\posh-git -ArgumentList $true |
Closes #163