Skip to content

Commit b6cba84

Browse files
committed
Merge pull request #407 from PowerShell/development
Merge Branches
2 parents 4c3466c + 9d59247 commit b6cba84

9 files changed

+15
-4
lines changed

Engine/Helper.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ public bool PositionalParameterUsed(CommandAst cmdAst, bool moreThanThreePositio
353353
arguments += 1;
354354
}
355355

356-
if (moreThanThreePositional && arguments < 3)
356+
// if we are only checking for 3 or more positional parameters, check that arguments < parameters + 3
357+
if (moreThanThreePositional && (arguments - parameters) < 3)
357358
{
358359
return false;
359360
}

Engine/ScriptAnalyzerEngine.csproj

+7-2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@
8686
<None Include="PSScriptAnalyzer.psd1" />
8787
<None Include="ScriptAnalyzer.format.ps1xml" />
8888
<None Include="ScriptAnalyzer.types.ps1xml" />
89+
<None Include="Settings\CmdletDesign.psd1" />
90+
<None Include="Settings\DSC.psd1" />
91+
<None Include="Settings\ScriptFunctions.psd1" />
92+
<None Include="Settings\ScriptingStyle.psd1" />
93+
<None Include="Settings\ScriptSecurity.psd1" />
8994
</ItemGroup>
9095
<ItemGroup>
9196
<EmbeddedResource Include="Strings.resx">
@@ -105,8 +110,8 @@
105110
if not exist "$(SolutionDir)$(SolutionName)" mkdir "$(SolutionDir)$(SolutionName)"
106111
copy /y "$(ProjectDir)*.ps1xml" "$(SolutionDir)$(SolutionName)"
107112
copy /y "$(ProjectDir)*.psd1" "$(SolutionDir)$(SolutionName)"
108-
if not exist "$(SolutionDir)$(SolutionName)\Configurations" mkdir "$(SolutionDir)$(SolutionName)\Configurations"
109-
copy /y "$(ProjectDir)Configurations\*.psd1" "$(SolutionDir)$(SolutionName)\Configurations"
113+
if not exist "$(SolutionDir)$(SolutionName)\Settings" mkdir "$(SolutionDir)$(SolutionName)\Settings"
114+
copy /y "$(ProjectDir)Settings\*.psd1" "$(SolutionDir)$(SolutionName)\Settings"
110115
copy /y "$(TargetPath)" "$(SolutionDir)$(SolutionName)"
111116
if not exist "$(SolutionDir)$(SolutionName)\en-US" mkdir "$(SolutionDir)$(SolutionName)\en-US"
112117
copy /y "$(ProjectDir)about_*.help.txt" "$(SolutionDir)$(SolutionName)\en-US"
File renamed without changes.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Announcements
44
##### ISE Add-On for ScriptAnalyzer is available in PowerShell Gallery!
55
(https://www.powershellgallery.com/packages/ISEScriptAnalyzerAddOn/)
66

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

912
##### ScriptAnalyzer community meeting schedule:

Tests/Rules/AvoidPositionalParametersNoViolations.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ Get-Content Test
2020
Get-ChildItem Tests
2121
Write-Output "I don't want to use positional parameters"
2222
Split-Path "RandomPath" -Leaf
23-
Get-Process | ForEach-Object {Write-Host $_.name -foregroundcolor cyan}
23+
Get-Process | ForEach-Object {Write-Host $_.name -foregroundcolor cyan}
24+
25+
$srvc = Get-WmiObject Win32_Service -ComputerName $computername -Filter "name=""$service""" -Credential $credential

0 commit comments

Comments
 (0)