Functions/Search-SMValue.ps1
function Search-TSMValue { param( [Parameter(Mandatory=$true)] [string]$SearchValue ) $ErrorActionPreference = 'Stop' $SECLst = Get-SECSecretList $SMArns = @() foreach($Sid in $SECLst){ $SMValue = (Get-SECSecretValue -SecretId $Sid.ARN).SecretString if($SMValue -match $SearchValue){ $SMArns += $Sid.ARN } } return $SMArns } |