From 5cb2d66d68a4dd7731218797bc1d10240288aa1e Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Mon, 18 Nov 2024 15:18:07 +0300 Subject: [PATCH 01/14] Cred scan --- .config/CredScanSuppressions.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .config/CredScanSuppressions.json diff --git a/.config/CredScanSuppressions.json b/.config/CredScanSuppressions.json new file mode 100644 index 0000000000..b868f2ab25 --- /dev/null +++ b/.config/CredScanSuppressions.json @@ -0,0 +1,9 @@ +{ + "tool": "Credential Scanner", + "suppressions": [ + { + "placeholder": "appStoreRequirePassword", + "_justification": "False Positive. This is a property value generated in the docstubs for the type appStoreRequirePassword not an actual password e.g. appStoreRequirePassword : Boolean" + } + ] +} \ No newline at end of file From f22e5b0fe8bc1aa9d4ea70ab694e0335ae9170fe Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 11:15:48 +0300 Subject: [PATCH 02/14] Config credscan --- .azure-pipelines/1es-entra-powershell-ci-build.yml | 6 ++++++ .configCredScanSuppressions.json | 0 2 files changed, 6 insertions(+) create mode 100644 .configCredScanSuppressions.json diff --git a/.azure-pipelines/1es-entra-powershell-ci-build.yml b/.azure-pipelines/1es-entra-powershell-ci-build.yml index 20001ad6ab..4f1ecf1f3d 100644 --- a/.azure-pipelines/1es-entra-powershell-ci-build.yml +++ b/.azure-pipelines/1es-entra-powershell-ci-build.yml @@ -32,6 +32,12 @@ extends: name: MSSecurity-1ES-Build-Agents-Pool image: MSSecurity-1ES-Windows-2022 os: windows + credscan: + # suppressionsFile: $(Build.SourcesDirectory)/.config/CredScanSuppressions.json + outputFormat: pre + debugMode: false + batchSize: 16 + scanFolder: $(Build.SourcesDirectory)/moduleVNext stages: - stage: build jobs: diff --git a/.configCredScanSuppressions.json b/.configCredScanSuppressions.json new file mode 100644 index 0000000000..e69de29bb2 From d9bde83ce208cdf2d1f886bdf4f6ce88fac2c2aa Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 11:33:44 +0300 Subject: [PATCH 03/14] Enable suppression file --- .azure-pipelines/1es-entra-powershell-ci-build.yml | 2 +- .config/CredScanSuppressions.json | 4 ++-- build/ValidateAuthenticodeSignature.ps1 | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/1es-entra-powershell-ci-build.yml b/.azure-pipelines/1es-entra-powershell-ci-build.yml index 4f1ecf1f3d..610f3ce918 100644 --- a/.azure-pipelines/1es-entra-powershell-ci-build.yml +++ b/.azure-pipelines/1es-entra-powershell-ci-build.yml @@ -33,7 +33,7 @@ extends: image: MSSecurity-1ES-Windows-2022 os: windows credscan: - # suppressionsFile: $(Build.SourcesDirectory)/.config/CredScanSuppressions.json + suppressionsFile: $(Build.SourcesDirectory)\.config\CredScanSuppressions.json outputFormat: pre debugMode: false batchSize: 16 diff --git a/.config/CredScanSuppressions.json b/.config/CredScanSuppressions.json index b868f2ab25..3ff230034a 100644 --- a/.config/CredScanSuppressions.json +++ b/.config/CredScanSuppressions.json @@ -2,8 +2,8 @@ "tool": "Credential Scanner", "suppressions": [ { - "placeholder": "appStoreRequirePassword", - "_justification": "False Positive. This is a property value generated in the docstubs for the type appStoreRequirePassword not an actual password e.g. appStoreRequirePassword : Boolean" + "placeholder": "$PasswordProfile.Password", + "_justification": "Paasword used in mocking unit tests." } ] } \ No newline at end of file diff --git a/build/ValidateAuthenticodeSignature.ps1 b/build/ValidateAuthenticodeSignature.ps1 index 3904e0c5e6..a75010abd9 100644 --- a/build/ValidateAuthenticodeSignature.ps1 +++ b/build/ValidateAuthenticodeSignature.ps1 @@ -1,8 +1,8 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# ------------------------------------------------------------------------------ -# [cmdletbinding()] -# param ( -# [string]$Module = "Entra" -# ) +Set-StrictMode -Version 5 . "$psscriptroot/common-functions.ps1" From eeca5c7beb70f2fc803d0d2c9ed73ffd86f68f0c Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 11:47:35 +0300 Subject: [PATCH 04/14] Reference files in suppressionfile --- .config/CredScanSuppressions.json | 32 +++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.config/CredScanSuppressions.json b/.config/CredScanSuppressions.json index 3ff230034a..8f8e3c7aa0 100644 --- a/.config/CredScanSuppressions.json +++ b/.config/CredScanSuppressions.json @@ -2,8 +2,36 @@ "tool": "Credential Scanner", "suppressions": [ { - "placeholder": "$PasswordProfile.Password", - "_justification": "Paasword used in mocking unit tests." + "file": "test\\module\\Entra\\Update-EntraSignedInUserPassword.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "test\\module\\Entra\\Update-EntraUserFromFederated.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "test\\module\\EntraBeta\\Update-EntraBetaSignedInUserPassword.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "test\\module\\EntraBeta\\Update-EntraBetaUserFromFederated.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "testVNext\\Entra\\Users\\Update-EntraSignedInUserPassword.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "testVNext\\Entra\\Users\\Update-EntraUserFromFederated.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "testVNext\\EntraBeta\\Users\\Update-EntraBetaSignedInUserPassword.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "testVNext\\EntraBeta\\Users\\Update-EntraBetaUserFromFederated.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." } ] } \ No newline at end of file From c439e7e1b4290542bdc11e1b2e377989e68d7fa9 Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 12:12:52 +0300 Subject: [PATCH 05/14] Add more credscan suppressions --- .config/CredScanSuppressions.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/CredScanSuppressions.json b/.config/CredScanSuppressions.json index 8f8e3c7aa0..9ce47d809b 100644 --- a/.config/CredScanSuppressions.json +++ b/.config/CredScanSuppressions.json @@ -32,6 +32,14 @@ { "file": "testVNext\\EntraBeta\\Users\\Update-EntraBetaUserFromFederated.Tests.ps1", "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "test\\module\\Entra\\New-EntraUser.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." + }, + { + "file": "testVNext\\Entra\\Users\\New-EntraUser.Tests.ps1", + "_justification": "Unit test file has a sample Password used in mocking." } ] } \ No newline at end of file From 44a0cf1bd2c9871aaba29141cb90053f930aa689 Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 16:12:16 +0300 Subject: [PATCH 06/14] No break psscriptanalyzer --- .azure-pipelines/1es-entra-powershell-ci-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/1es-entra-powershell-ci-build.yml b/.azure-pipelines/1es-entra-powershell-ci-build.yml index 610f3ce918..d43b9004ae 100644 --- a/.azure-pipelines/1es-entra-powershell-ci-build.yml +++ b/.azure-pipelines/1es-entra-powershell-ci-build.yml @@ -37,7 +37,9 @@ extends: outputFormat: pre debugMode: false batchSize: 16 - scanFolder: $(Build.SourcesDirectory)/moduleVNext + psscriptanalyzer: + break: false + enabled: true stages: - stage: build jobs: From c9d8827c1612115e96df7b210f3d84f8556ba417 Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 16:45:43 +0300 Subject: [PATCH 07/14] Suppress 1 PSScriptAnalyzer error --- moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 index 1a9dd81a22..0073d2a46f 100644 --- a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 +++ b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function New-EntraUser { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUsernameAndPasswordParams', 'PasswordProfile')] [CmdletBinding(DefaultParameterSetName = 'InvokeByDynamicParameters')] param ( From 6f8f7a272a75f1de0d4dd3904ef59df75c5442eb Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 17:11:15 +0300 Subject: [PATCH 08/14] Update suppression --- moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 index 0073d2a46f..b526e1be67 100644 --- a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 +++ b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function New-EntraUser { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUsernameAndPasswordParams', 'PasswordProfile')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "PasswordProfile", Scope="Function")] [CmdletBinding(DefaultParameterSetName = 'InvokeByDynamicParameters')] param ( From d4d29b4cd5c4fcb91bd801ff99d167b24c98ec9c Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 17:36:03 +0300 Subject: [PATCH 09/14] Update suppressions --- moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 | 2 +- moduleVNext/Entra/Microsoft.Graph.Entra/Users/Set-EntraUser.ps1 | 1 + .../Users/Update-EntraUserFromFederated.ps1 | 1 + .../Microsoft.Graph.Entra.Beta/Users/New-EntraBetaUser.ps1 | 1 + .../Microsoft.Graph.Entra.Beta/Users/Set-EntraBetaUser.ps1 | 1 + .../Users/Update-EntraBetaUserFromFederated.ps1 | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 index b526e1be67..68616d017c 100644 --- a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 +++ b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/New-EntraUser.ps1 @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function New-EntraUser { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "PasswordProfile", Scope="Function")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "", Scope="Function", Target="*")] [CmdletBinding(DefaultParameterSetName = 'InvokeByDynamicParameters')] param ( diff --git a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Set-EntraUser.ps1 b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Set-EntraUser.ps1 index b14221cd9d..accbb1423b 100644 --- a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Set-EntraUser.ps1 +++ b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Set-EntraUser.ps1 @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Set-EntraUser { + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "", Scope="Function", Target="*")] [CmdletBinding(DefaultParameterSetName = 'InvokeByDynamicParameters')] param ( diff --git a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Update-EntraUserFromFederated.ps1 b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Update-EntraUserFromFederated.ps1 index b5e4230487..873e5ef61b 100644 --- a/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Update-EntraUserFromFederated.ps1 +++ b/moduleVNext/Entra/Microsoft.Graph.Entra/Users/Update-EntraUserFromFederated.ps1 @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Update-EntraUserFromFederated { + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "", Scope="Function", Target="*")] [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)][System.String] $UserPrincipalName, diff --git a/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/New-EntraBetaUser.ps1 b/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/New-EntraBetaUser.ps1 index b9a46bc8d8..af5a8529c1 100644 --- a/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/New-EntraBetaUser.ps1 +++ b/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/New-EntraBetaUser.ps1 @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function New-EntraBetaUser { + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "", Scope="Function", Target="*")] [CmdletBinding(DefaultParameterSetName = 'InvokeByDynamicParameters')] param ( diff --git a/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Set-EntraBetaUser.ps1 b/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Set-EntraBetaUser.ps1 index 83a0491f5b..71a65d71fe 100644 --- a/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Set-EntraBetaUser.ps1 +++ b/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Set-EntraBetaUser.ps1 @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Set-EntraBetaUser { + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "", Scope="Function", Target="*")] [CmdletBinding(DefaultParameterSetName = 'InvokeByDynamicParameters')] param ( diff --git a/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Update-EntraBetaUserFromFederated.ps1 b/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Update-EntraBetaUserFromFederated.ps1 index 38cf3dee80..a2c4544441 100644 --- a/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Update-EntraBetaUserFromFederated.ps1 +++ b/moduleVNext/EntraBeta/Microsoft.Graph.Entra.Beta/Users/Update-EntraBetaUserFromFederated.ps1 @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Update-EntraBetaUserFromFederated { + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams", "", Scope="Function", Target="*")] [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)][System.String] $UserPrincipalName, From c928e86820010f5e192d8682d59e23b140f36ac9 Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 17:49:14 +0300 Subject: [PATCH 10/14] Add suppressions to tests --- testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 | 2 ++ .../Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 | 1 + .../Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 | 1 + 3 files changed, 4 insertions(+) diff --git a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 index e3f259d7c1..50f7840b77 100644 --- a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ + +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] BeforeAll { if((Get-Module -Name Microsoft.Graph.Entra.Users) -eq $null){ Import-Module Microsoft.Graph.Entra.Users diff --git a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 index f1d0495279..a154b4a05b 100644 --- a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] BeforeAll{ if((Get-Module -Name Microsoft.Graph.Entra.Users) -eq $null){ Import-Module Microsoft.Graph.Entra.Users diff --git a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 index ba378a9889..56a2d7d90c 100644 --- a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 +++ b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 @@ -2,6 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] BeforeAll { if((Get-Module -Name Microsoft.Graph.Entra.Beta.Users) -eq $null){ Import-Module Microsoft.Graph.Entra.Beta.Users From db2bde5ea6a2d3af95267eb6b3998cb980797dd6 Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 18:02:48 +0300 Subject: [PATCH 11/14] Update suppressions to tests --- testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 | 2 ++ .../Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 | 2 ++ .../Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 | 2 ++ 3 files changed, 6 insertions(+) diff --git a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 index 50f7840b77..d6a4448963 100644 --- a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 @@ -3,6 +3,8 @@ # ------------------------------------------------------------------------------ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] +param() + BeforeAll { if((Get-Module -Name Microsoft.Graph.Entra.Users) -eq $null){ Import-Module Microsoft.Graph.Entra.Users diff --git a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 index a154b4a05b..af0d6f9b3f 100644 --- a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 @@ -3,6 +3,8 @@ # ------------------------------------------------------------------------------ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] +param() + BeforeAll{ if((Get-Module -Name Microsoft.Graph.Entra.Users) -eq $null){ Import-Module Microsoft.Graph.Entra.Users diff --git a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 index 56a2d7d90c..2c4fe21732 100644 --- a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 +++ b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 @@ -3,6 +3,8 @@ # ------------------------------------------------------------------------------ [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] +param() + BeforeAll { if((Get-Module -Name Microsoft.Graph.Entra.Beta.Users) -eq $null){ Import-Module Microsoft.Graph.Entra.Beta.Users From ab2ca969197dca4fe804a94230948b9940596f2b Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 18:27:53 +0300 Subject: [PATCH 12/14] Remove targets --- testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 | 2 +- .../Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 | 2 +- .../Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 index d6a4448963..01405974b7 100644 --- a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function")] param() BeforeAll { diff --git a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 index af0d6f9b3f..8a0a62a5f5 100644 --- a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function")] param() BeforeAll{ diff --git a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 index 2c4fe21732..b84d7d9e4d 100644 --- a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 +++ b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function", Target="*")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function")] param() BeforeAll { From 224716da6c03d3e6b49ae803ad3a7f0f206ded16 Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 20:15:05 +0300 Subject: [PATCH 13/14] Update suppressions --- testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 | 2 +- .../Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 | 2 +- .../Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 index 01405974b7..9c50ccbbcc 100644 --- a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText")] param() BeforeAll { diff --git a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 index 8a0a62a5f5..3e4a4a5a3f 100644 --- a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText")] param() BeforeAll{ diff --git a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 index b84d7d9e4d..805d680b6a 100644 --- a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 +++ b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "", Scope="Function")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText")] param() BeforeAll { From cc1bcc4667e79e5f65a0aa9155f56333468f2609 Mon Sep 17 00:00:00 2001 From: Kennedy Kangethe Munga Date: Tue, 19 Nov 2024 20:54:10 +0300 Subject: [PATCH 14/14] Update suppressions --- testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 | 2 +- .../Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 | 2 +- .../Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 index 9c50ccbbcc..c52dbb7607 100644 --- a/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Set-EntraUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param() BeforeAll { diff --git a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 index 3e4a4a5a3f..711ec74034 100644 --- a/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 +++ b/testVNext/Entra/Users/Update-EntraSignedInUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param() BeforeAll{ diff --git a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 index 805d680b6a..f25a87c45d 100644 --- a/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 +++ b/testVNext/EntraBeta/Users/Update-EntraBetaSignedInUserPassword.Tests.ps1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ -[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText")] +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param() BeforeAll {