@@ -41,47 +41,47 @@ function New-Nuspec
41
41
param
42
42
(
43
43
[Parameter (Mandatory = $true )]
44
- [String ]
44
+ [System. String ]
45
45
$PackageName ,
46
46
47
47
[Parameter (Mandatory = $true )]
48
- [String ]
48
+ [System. String ]
49
49
$Version ,
50
50
51
51
[Parameter (Mandatory = $true )]
52
- [String ]
52
+ [System. String ]
53
53
$Author ,
54
54
55
55
[Parameter (Mandatory = $true )]
56
- [String ]
56
+ [System. String ]
57
57
$Owners ,
58
58
59
59
[Parameter (Mandatory = $true )]
60
- [String ]
60
+ [System. String ]
61
61
$DestinationPath ,
62
62
63
63
[Parameter ()]
64
- [String ]
64
+ [System. String ]
65
65
$LicenseUrl ,
66
66
67
67
[Parameter ()]
68
- [String ]
68
+ [System. String ]
69
69
$ProjectUrl ,
70
70
71
71
[Parameter ()]
72
- [String ]
72
+ [System. String ]
73
73
$IconUrl ,
74
74
75
75
[Parameter ()]
76
- [String ]
76
+ [System. String ]
77
77
$PackageDescription ,
78
78
79
79
[Parameter ()]
80
- [String ]
80
+ [System. String ]
81
81
$ReleaseNotes ,
82
82
83
83
[Parameter ()]
84
- [String ]
84
+ [System. String ]
85
85
$Tags
86
86
)
87
87
@@ -97,21 +97,21 @@ function New-Nuspec
97
97
<owners>$Owners </owners>
98
98
"@
99
99
100
- if (-not [String ]::IsNullOrEmpty($LicenseUrl ))
100
+ if (-not [System. String ]::IsNullOrEmpty($LicenseUrl ))
101
101
{
102
102
$nuspecFileContent += @"
103
103
<licenseUrl>$LicenseUrl </licenseUrl>
104
104
"@
105
105
}
106
106
107
- if (-not [String ]::IsNullOrEmpty($ProjectUrl ))
107
+ if (-not [System. String ]::IsNullOrEmpty($ProjectUrl ))
108
108
{
109
109
$nuspecFileContent += @"
110
110
<projectUrl>$ProjectUrl </projectUrl>
111
111
"@
112
112
}
113
113
114
- if (-not [String ]::IsNullOrEmpty($IconUrl ))
114
+ if (-not [System. String ]::IsNullOrEmpty($IconUrl ))
115
115
{
116
116
$nuspecFileContent += @"
117
117
<iconUrl>$IconUrl </iconUrl>
@@ -156,11 +156,11 @@ function Install-ModuleFromPowerShellGallery
156
156
param
157
157
(
158
158
[Parameter (Mandatory = $true )]
159
- [String ]
159
+ [System. String ]
160
160
$ModuleName ,
161
161
162
162
[Parameter (Mandatory = $true )]
163
- [String ]
163
+ [System. String ]
164
164
$DestinationPath
165
165
)
166
166
@@ -285,22 +285,22 @@ function Initialize-TestEnvironment
285
285
(
286
286
[Parameter (Mandatory = $true )]
287
287
[ValidateNotNullOrEmpty ()]
288
- [String ]
288
+ [System. String ]
289
289
$DscModuleName ,
290
290
291
291
[Parameter (Mandatory = $true )]
292
292
[ValidateNotNullOrEmpty ()]
293
- [String ]
293
+ [System. String ]
294
294
$DscResourceName ,
295
295
296
296
[Parameter (Mandatory = $true )]
297
297
[ValidateSet (' Unit' , ' Integration' )]
298
- [String ]
298
+ [System. String ]
299
299
$TestType ,
300
300
301
301
[Parameter ()]
302
302
[ValidateSet (' Mof' , ' Class' )]
303
- [String ]
303
+ [System. String ]
304
304
$ResourceType = ' Mof'
305
305
)
306
306
@@ -522,13 +522,14 @@ function Test-FileContainsClassResource
522
522
param
523
523
(
524
524
[Parameter (ValueFromPipeline = $true , Mandatory = $true )]
525
- [String ]
525
+ [System. String ]
526
526
$FilePath
527
527
)
528
528
529
529
$fileAst = [System.Management.Automation.Language.Parser ]::ParseFile($FilePath , [ref ]$null , [ref ]$null )
530
+ $attributeAst = $fileAst.FindAll ( { $args [0 ] -is [System.Management.Automation.Language.AttributeAst ] }, $false )
530
531
531
- foreach ($fileAttributeAst in $fileAst .FindAll ( { $args [ 0 ] -is [ System.Management.Automation.Language.AttributeAst ] } , $false ) )
532
+ foreach ($fileAttributeAst in $attributeAst )
532
533
{
533
534
if ($fileAttributeAst.Extent.Text -ieq ' [DscResource()]' )
534
535
{
@@ -558,7 +559,7 @@ function Get-ClassResourceNameFromFile
558
559
param
559
560
(
560
561
[Parameter (ValueFromPipeline = $true , Mandatory = $true )]
561
- [String ]
562
+ [System. String ]
562
563
$FilePath
563
564
)
564
565
@@ -595,7 +596,7 @@ function Test-ModuleContainsScriptResource
595
596
param
596
597
(
597
598
[Parameter (ValueFromPipeline = $true , Mandatory = $true )]
598
- [String ]
599
+ [System. String ]
599
600
$ModulePath
600
601
)
601
602
@@ -619,7 +620,7 @@ function Test-ModuleContainsClassResource
619
620
param
620
621
(
621
622
[Parameter (ValueFromPipeline = $true , Mandatory = $true )]
622
- [String ]
623
+ [System. String ]
623
624
$ModulePath
624
625
)
625
626
@@ -650,7 +651,7 @@ function Get-Psm1FileList
650
651
param
651
652
(
652
653
[Parameter (ValueFromPipeline = $true , Mandatory = $true )]
653
- [String ]
654
+ [System. String ]
654
655
$FilePath
655
656
)
656
657
@@ -671,7 +672,7 @@ function Get-FileParseErrors
671
672
param
672
673
(
673
674
[Parameter (ValueFromPipeline = $true , Mandatory = $true )]
674
- [String ]
675
+ [System. String ]
675
676
$FilePath
676
677
)
677
678
@@ -699,7 +700,7 @@ function Get-TextFilesList
699
700
param
700
701
(
701
702
[Parameter (Mandatory = $true )]
702
- [String ]
703
+ [System. String ]
703
704
$Root
704
705
)
705
706
@@ -747,7 +748,7 @@ function Get-ModuleScriptResourceNames
747
748
param
748
749
(
749
750
[Parameter (ValueFromPipeline = $true , Mandatory = $true )]
750
- [String ]
751
+ [System. String ]
751
752
$ModulePath
752
753
)
753
754
@@ -847,7 +848,7 @@ function Get-SuppressedPSSARuleNameList
847
848
param
848
849
(
849
850
[Parameter (Mandatory = $true )]
850
- [String ]
851
+ [System. String ]
851
852
$FilePath
852
853
)
853
854
@@ -860,7 +861,9 @@ function Get-SuppressedPSSARuleNameList
860
861
861
862
foreach ($attributeAst in $attributeAsts )
862
863
{
863
- if ([System.Diagnostics.CodeAnalysis.SuppressMessageAttribute ].FullName.ToLower().Contains($attributeAst.TypeName.FullName.ToLower ()))
864
+ $messageAttributeName = [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute ].FullName.ToLower()
865
+
866
+ if ($messageAttributeName.Contains ($attributeAst.TypeName.FullName.ToLower ()))
864
867
{
865
868
$suppressedPSSARuleNames += $attributeAst.PositionalArguments.Extent.Text
866
869
}
@@ -1255,9 +1258,9 @@ function Get-ResourceModulesInConfiguration
1255
1258
} # foreach
1256
1259
1257
1260
# Did a module get identified when stepping through the elements?
1258
- if (-not [String ]::IsNullOrEmpty($moduleName ))
1261
+ if (-not [System. String ]::IsNullOrEmpty($moduleName ))
1259
1262
{
1260
- if ([String ]::IsNullOrEmpty($moduleVersion ))
1263
+ if ([System. String ]::IsNullOrEmpty($moduleVersion ))
1261
1264
{
1262
1265
$listedModules += @ {
1263
1266
Name = $moduleName
@@ -1401,7 +1404,7 @@ function Get-DscIntegrationTestOrderNumber
1401
1404
(
1402
1405
[Parameter ()]
1403
1406
[ValidateNotNullOrEmpty ()]
1404
- [String ]
1407
+ [System. String ]
1405
1408
$Path
1406
1409
)
1407
1410
@@ -1476,7 +1479,7 @@ function Get-DscTestContainerInformation
1476
1479
(
1477
1480
[Parameter ()]
1478
1481
[ValidateNotNullOrEmpty ()]
1479
- [String ]
1482
+ [System. String ]
1480
1483
$Path
1481
1484
)
1482
1485
@@ -1627,7 +1630,7 @@ function Set-PSModulePath
1627
1630
(
1628
1631
[Parameter (Mandatory = $true )]
1629
1632
[ValidateNotNullOrEmpty ()]
1630
- [String ]
1633
+ [System. String ]
1631
1634
$Path ,
1632
1635
1633
1636
[Parameter ()]
@@ -1670,10 +1673,10 @@ function Write-Info
1670
1673
$ForegroundColor = ' Yellow'
1671
1674
)
1672
1675
1673
- $curentColor = $host.ui .RawUI.ForegroundColor
1674
- $host.ui .RawUI.ForegroundColor = $ForegroundColor
1676
+ $curentColor = $host.UI .RawUI.ForegroundColor
1677
+ $host.UI .RawUI.ForegroundColor = $ForegroundColor
1675
1678
Write-Information - MessageData " [Build Info] [UTC $ ( [System.DateTime ]::UtcNow) ] $message "
1676
- $host.ui .RawUI.ForegroundColor = $curentColor
1679
+ $host.UI .RawUI.ForegroundColor = $curentColor
1677
1680
}
1678
1681
1679
1682
<#
@@ -2045,7 +2048,7 @@ function Write-PsScriptAnalyzerWarning
2045
2048
$PssaRuleOutput ,
2046
2049
2047
2050
[Parameter (Mandatory = $true )]
2048
- [string ]
2051
+ [System.String ]
2049
2052
$RuleType
2050
2053
)
2051
2054
@@ -2055,6 +2058,7 @@ function Write-PsScriptAnalyzerWarning
2055
2058
foreach ($ruleNameGroup in $ruleCollection )
2056
2059
{
2057
2060
Write-Warning - Message " The following PSScriptAnalyzer rule '$ ( $ruleNameGroup.Name ) ' errors need to be fixed:"
2061
+
2058
2062
foreach ($rule in $ruleNameGroup.Group )
2059
2063
{
2060
2064
Write-Warning - Message " $ ( $rule.ScriptName ) (Line $ ( $rule.Line ) ): $ ( $rule.Message ) "
0 commit comments