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

Auto fix PSScriptAnalyzer warnings (aliases) #509

Merged
merged 2 commits into from
Dec 27, 2017
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
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