Skip to content

Commit

Permalink
Merge pull request #509 from bergmeister/AutoFixPSSAWarnings
Browse files Browse the repository at this point in the history
Auto fix PSScriptAnalyzer warnings (aliases)
  • Loading branch information
dahlbyk authored Dec 27, 2017
2 parents 0618094 + 95e2457 commit 4014907
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions chocolatey/packAndLocalInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param ($Remote = 'origin', [switch]$Force)
pushd $PSScriptRoot
Push-Location $PSScriptRoot

$nuspec = [xml](Get-Content poshgit.nuspec)
$version = $nuspec.package.metadata.version
Expand All @@ -17,4 +17,4 @@ elseif (!$(git ls-remote $Remote $tag)) {
choco pack poshgit.nuspec
choco install -f -y poshgit -pre --version=$version -s .

popd
Pop-Location
20 changes: 10 additions & 10 deletions chocolatey/tests/InstallChocolatey.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Describe "Install-Posh-Git" {
RunInstall

$newProfile = (Get-Content $Profile)
$pgitDir = [Array](Dir "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
$pgitDir = [Array](Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
($newProfile -like ". '$poshgitPath\posh-git\profile.example.ps1'").Count.should.be(0)
($newProfile -like ". '$pgitDir\profile.example.ps1'").Count.should.be(1)
}
Expand All @@ -59,7 +59,7 @@ Describe "Install-Posh-Git" {
RunInstall

$newProfile = (Get-Content $Profile)
$pgitDir = [Array](Dir "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
$pgitDir = [Array](Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
($newProfile -like ". '$pgitDir\profile.example.ps1'").Count.should.be(1)
}
catch {
Expand Down Expand Up @@ -94,15 +94,15 @@ Describe "Install-Posh-Git" {
try{
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
. $Profile
$global:wh=""
New-Item function:\global:Write-Host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) try{Write-Output `$object;[string]`$global:wh += `$object.ToString()} catch{}"

Prompt

Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand All @@ -122,15 +122,15 @@ Describe "Install-Posh-Git" {
Remove-Item $Profile -Force
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
. $Profile
$global:wh=""
New-Item function:\global:Write-Host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) try{Write-Output `$object;[string]`$global:wh += `$object.ToString()} catch{}"

Prompt

Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand All @@ -152,7 +152,7 @@ Describe "Install-Posh-Git" {
Add-Content $profile -value "function prompt {Write-Host 'Hi'}" -Force
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
. $Profile
$global:wh=""
Expand All @@ -161,7 +161,7 @@ Describe "Install-Posh-Git" {
Prompt

Remove-Item function:\global:Write-Host
Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand All @@ -183,7 +183,7 @@ Describe "Install-Posh-Git" {
Add-Content $profile -value ". 'C:\tools\poshgit\dahlbyk-posh-git-60be436\profile.example.ps1'" -Force
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
write-output (Get-Content function:\prompt)
. $Profile
Expand All @@ -193,7 +193,7 @@ Describe "Install-Posh-Git" {
Prompt

Remove-Item function:\global:Write-Host
Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand Down

0 comments on commit 4014907

Please sign in to comment.