Skip to content

Commit 7579278

Browse files
committed
Added in a few script analyzer rule suppressions with SuppressMessageAttribute.
1 parent 5301f4e commit 7579278

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/Build.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ Task StoreKey -requiredVariables EncryptedApiKeyPath {
193193
}
194194

195195
Task ShowKey -requiredVariables EncryptedApiKeyPath {
196-
$OFS = ''
197-
198196
if ($NuGetApiKey) {
199197
"The embedded (partial) NuGetApiKey is: $($NuGetApiKey[0..7])"
200198
}
@@ -225,6 +223,7 @@ Task ? -description 'Lists the available tasks' {
225223
# Helper functions
226224
###############################################################################
227225
function PromptUserForNuGetApiKeyCredential {
226+
[Diagnostics.CodeAnalysis.SuppressMessage("PSProvideDefaultParameterValue", '')]
228227
param(
229228
[Parameter()]
230229
[ValidateNotNullOrEmpty()]
@@ -243,6 +242,8 @@ function PromptUserForNuGetApiKeyCredential {
243242
}
244243

245244
function EncryptAndSaveNuGetApiKey {
245+
[Diagnostics.CodeAnalysis.SuppressMessage("PSAvoidUsingConvertToSecureStringWithPlainText", '')]
246+
[Diagnostics.CodeAnalysis.SuppressMessage("PSProvideDefaultParameterValue", '')]
246247
param(
247248
[Parameter(Mandatory, ParameterSetName='SecureString')]
248249
[ValidateNotNull()]
@@ -275,6 +276,7 @@ function EncryptAndSaveNuGetApiKey {
275276
}
276277

277278
function LoadAndUnencryptNuGetApiKey {
279+
[Diagnostics.CodeAnalysis.SuppressMessage("PSProvideDefaultParameterValue", '')]
278280
param(
279281
[Parameter(Mandatory)]
280282
[ValidateNotNullOrEmpty()]

0 commit comments

Comments
 (0)