[release/v7.4] Suppress false positive PSScriptAnalyzer warnings in tests and build scripts (#26058)

This commit is contained in:
PowerShell Team Bot
2025-10-09 15:54:03 -07:00
committed by GitHub
parent 3b631f39b7
commit 010da3a003
16 changed files with 127 additions and 103 deletions
@@ -1,5 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
Describe "Serialization Tests" -tags "CI" {
BeforeAll {
$testfileName="SerializationTest.txt"
@@ -99,4 +103,3 @@ Describe "Serialization Tests" -tags "CI" {
SerializeAndDeserialize($versionObject).TestScriptProperty | Should -Be $versionObject.TestScriptProperty
}
}
@@ -5,6 +5,9 @@
# PSSession tests for non-Windows platforms
#
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
function GetRandomString()
{
return [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetRandomFileName())
@@ -1,6 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
Import-Module HelpersCommon
function GetRandomString()