Skip to content

Warn of PowerShell 2.0 deprecation#186

Merged
dahlbyk merged 4 commits intodahlbyk:masterfrom
theaquamarine:deprecate
May 14, 2015
Merged

Warn of PowerShell 2.0 deprecation#186
dahlbyk merged 4 commits intodahlbyk:masterfrom
theaquamarine:deprecate

Conversation

@theaquamarine
Copy link
Copy Markdown
Collaborator

Closes #163

posh-git.psm1 Outdated
Copy link
Copy Markdown
Owner

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).

@dahlbyk
Copy link
Copy Markdown
Owner

dahlbyk commented May 14, 2015

So sorry for the delay in looking at this. Looks great other than my comment on $Host.

readme.md Outdated
Copy link
Copy Markdown
Owner

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
@theaquamarine
Copy link
Copy Markdown
Collaborator Author

Version check fixed, conflict fixed.

dahlbyk added a commit that referenced this pull request May 14, 2015
Warn of PowerShell 2.0 deprecation
@dahlbyk dahlbyk merged commit f948f5a into dahlbyk:master May 14, 2015
@dahlbyk
Copy link
Copy Markdown
Owner

dahlbyk commented May 14, 2015

Perfect, thanks!

@haacked haacked mentioned this pull request Mar 2, 2016
@dingmanyao
Copy link
Copy Markdown

Solve the problem of warning, can modified first line of the posh-git.psm1:
param([switch]$NoVersionWarn = $false) ==>param([switch]$NoVersionWarn = $true)
image
这个问题是因为PowerShell3.0需要软件支持,你的系统没有所以无法升级到3.0,但是使用2.0就有警告,那么两种办法:1.去掉警告,继续使用2.0,不要升级,用上面的办法就可以;2.打开https://www.microsoft.com/en-us/download/details.aspx?id=34595 下载需要的软件,再升级。

@dahlbyk
Copy link
Copy Markdown
Owner

dahlbyk commented Jun 25, 2016

Solve the problem of warning, can modified first line of the posh-git.psm1:

Rather than modify the module, I would suggest updating profile.example.ps1 (or copy its contents into your own $PROFILE) to change the Import-Module line to:

Import-Module .\posh-git -ArgumentList $true

@dahlbyk dahlbyk mentioned this pull request Dec 29, 2016
13 tasks
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.

Deprecate PowerShell 2.0 Support

3 participants