Skip to content

Commit

Permalink
Merge pull request #407 from PowerShell/development
Browse files Browse the repository at this point in the history
Merge Branches
  • Loading branch information
raghushantha committed Dec 16, 2015
2 parents 4c3466c + 9d59247 commit b6cba84
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Engine/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ public bool PositionalParameterUsed(CommandAst cmdAst, bool moreThanThreePositio
arguments += 1;
}

if (moreThanThreePositional && arguments < 3)
// if we are only checking for 3 or more positional parameters, check that arguments < parameters + 3
if (moreThanThreePositional && (arguments - parameters) < 3)
{
return false;
}
Expand Down
9 changes: 7 additions & 2 deletions Engine/ScriptAnalyzerEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
<None Include="PSScriptAnalyzer.psd1" />
<None Include="ScriptAnalyzer.format.ps1xml" />
<None Include="ScriptAnalyzer.types.ps1xml" />
<None Include="Settings\CmdletDesign.psd1" />
<None Include="Settings\DSC.psd1" />
<None Include="Settings\ScriptFunctions.psd1" />
<None Include="Settings\ScriptingStyle.psd1" />
<None Include="Settings\ScriptSecurity.psd1" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Strings.resx">
Expand All @@ -105,8 +110,8 @@
if not exist "$(SolutionDir)$(SolutionName)" mkdir "$(SolutionDir)$(SolutionName)"
copy /y "$(ProjectDir)*.ps1xml" "$(SolutionDir)$(SolutionName)"
copy /y "$(ProjectDir)*.psd1" "$(SolutionDir)$(SolutionName)"
if not exist "$(SolutionDir)$(SolutionName)\Configurations" mkdir "$(SolutionDir)$(SolutionName)\Configurations"
copy /y "$(ProjectDir)Configurations\*.psd1" "$(SolutionDir)$(SolutionName)\Configurations"
if not exist "$(SolutionDir)$(SolutionName)\Settings" mkdir "$(SolutionDir)$(SolutionName)\Settings"
copy /y "$(ProjectDir)Settings\*.psd1" "$(SolutionDir)$(SolutionName)\Settings"
copy /y "$(TargetPath)" "$(SolutionDir)$(SolutionName)"
if not exist "$(SolutionDir)$(SolutionName)\en-US" mkdir "$(SolutionDir)$(SolutionName)\en-US"
copy /y "$(ProjectDir)about_*.help.txt" "$(SolutionDir)$(SolutionName)\en-US"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Announcements
##### ISE Add-On for ScriptAnalyzer is available in PowerShell Gallery!
(https://www.powershellgallery.com/packages/ISEScriptAnalyzerAddOn/)

##### Visual Studio Code now has PowerShell language support with ScriptAnalyzer integration
(http://blogs.msdn.com/b/powershell/archive/2015/11/17/announcing-windows-powershell-for-visual-studio-code-and-more.aspx)

=============

##### ScriptAnalyzer community meeting schedule:
Expand Down
4 changes: 3 additions & 1 deletion Tests/Rules/AvoidPositionalParametersNoViolations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ Get-Content Test
Get-ChildItem Tests
Write-Output "I don't want to use positional parameters"
Split-Path "RandomPath" -Leaf
Get-Process | ForEach-Object {Write-Host $_.name -foregroundcolor cyan}
Get-Process | ForEach-Object {Write-Host $_.name -foregroundcolor cyan}

$srvc = Get-WmiObject Win32_Service -ComputerName $computername -Filter "name=""$service""" -Credential $credential

0 comments on commit b6cba84

Please sign in to comment.