Skip to content

Commit

Permalink
Merge pull request #186 from theaquamarine/deprecate
Browse files Browse the repository at this point in the history
Warn of PowerShell 2.0 deprecation
  • Loading branch information
dahlbyk committed May 14, 2015
2 parents 81f58e9 + c71a174 commit f948f5a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
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.

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

0 comments on commit f948f5a

Please sign in to comment.