File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
PSModuleDevelopment/functions/utility Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 98
98
99
99
if (-not ($null -eq $inputParameterMatch )) {
100
100
$inputParameterNames = $inputParameterMatch.Value.Trim (" -" , " " )
101
+ Write-PSFMessage - Level Verbose - Message " All input parameters - $ ( $inputParameterNames -join " ," ) " - Target ($inputParameterNames -join " ," )
101
102
}
102
103
else {
103
104
Write-PSFMessage - Level Host - Message " The function was unable to extract any parameters from the supplied command text. Please try again."
106
107
}
107
108
108
109
$availableParameterNames = (Get-Command $commandName ).Parameters.keys | Where-Object {$commonParameters -NotContains $_ }
110
+ Write-PSFMessage - Level Verbose - Message " Available parameters - $ ( $availableParameterNames -join " ," ) " - Target ($availableParameterNames -join " ," )
111
+
109
112
$inputParameterNotFound = $inputParameterNames | Where-Object {$availableParameterNames -NotContains $_ }
110
113
111
- $null = $sbParmsNotFound.AppendLine (" Parameters that <c='em'>don't exists</c>" )
112
- $inputParameterNotFound | ForEach-Object {
113
- $null = $sbParmsNotFound.AppendLine (" <c='$colorParmsNotFound '>$ ( $_ ) </c>" )
114
+ if ($inputParameterNotFound.Length -gt 0 ) {
115
+ $null = $sbParmsNotFound.AppendLine (" Parameters that <c='em'>don't exists</c>" )
116
+ $inputParameterNotFound | ForEach-Object {
117
+ $null = $sbParmsNotFound.AppendLine (" <c='$colorParmsNotFound '>$ ( $_ ) </c>" )
118
+ }
114
119
}
115
-
120
+
116
121
foreach ($parmSet in (Get-Command $commandName ).ParameterSets) {
117
122
$sb = New-Object System.Text.StringBuilder
118
123
$null = $sb.AppendLine (" ParameterSet Name: <c='em'>$ ( $parmSet.Name ) </c> - Validated List" )
193
198
Default {}
194
199
}
195
200
196
- if ($sbParmsNotFound.Length -gt 0 ) {
201
+ if ($sbParmsNotFound.ToString ().Trim(). Length -gt 0 ) {
197
202
Write-PSFHostColor - String " $ ( $sbParmsNotFound.ToString ()) "
198
203
}
199
204
You can’t perform that action at this time.
0 commit comments