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

Warn of PowerShell 2.0 deprecation #186

Merged
merged 4 commits into from
May 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions posh-git.psm1
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
param([switch]$NoVersionWarn = $false)

if (Get-Module posh-git) { return }

$psv = $PSVersionTable.PSVersion

if ($psv.Major -lt 3 -and !$NoVersionWarn) {
Write-Warning ("posh-git support for PowerShell 2.0 is deprecated; you have version $($psv).`n" +
"To download version 3.0, please visit https://www.microsoft.com/en-us/download/details.aspx?id=34595`n" +
"For more information and to discuss this, please visit https://github.com/dahlbyk/posh-git/issues/163`n" +
"To suppress this warning, change your profile to include 'Import-Module posh-git -Args `$true'.")
}

Push-Location $psScriptRoot
.\CheckVersion.ps1 > $null

Expand All @@ -23,8 +34,8 @@ Export-ModuleMember `
'Invoke-NullCoalescing',
'Write-GitStatus',
'Write-Prompt',
'Get-GitStatus',
'Enable-GitColors',
'Get-GitStatus',
'Enable-GitColors',
'Get-GitDirectory',
'TabExpansion',
'Get-AliasPattern',
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ A set of PowerShell scripts which provide Git/PowerShell integration

### Prompt for Git repositories
The prompt within Git repositories can show the current branch and the state of files (additions, modifications, deletions) within.

### Tab completion
Provides tab completion for common commands when using git.
Provides tab completion for common commands when using git.
E.g. `git ch<tab>` --> `git checkout`

Usage
-----

Expand All @@ -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.
Copy link
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).


1. Verify execution of scripts is allowed with `Get-ExecutionPolicy` (should be `RemoteSigned` or `Unrestricted`). If scripts are not enabled, run PowerShell as Administrator and call `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm`.

Expand Down