Is there any way to avoid making many calls if it's neсessary to do smth like this:
Get-ChildItem $pathCertSuspendedValidExport -Name|ForEach-Object -Process {$SN=$_ -replace ".cer"; Connect-CertificationAuthority -ComputerName $CN|Get-IssuedRequest -Filter "Disposition -eq 20","NotAfter -ge $DT","SerialNumber -eq $SN" -Property "RawCertificate"| %{[IO.File]::WriteAllText("$pathCertIssuedExport\$($_.SerialNumber).cer", $_.RawCertificate)}}
$pathCertSuspendedValidExport contains all valid suspended certificates, so i'm truing to find out if there is any of them that become unrevoked
I've tried to put all filenames in $pathCertSuspendedValidExport in massive by this code:
$SN = @(Get-ChildItem $pathCertSuspendedValidExport -Name -exclude "DT.txt"|ForEach-Object -process {$_ -replace ".cer"})
But don't know how to compare SerialNumber in filter with every massive value without using foreach.
Get-ChildItem $pathCertSuspendedValidExport -Name|ForEach-Object -Process {$SN=$_ -replace ".cer"; Connect-CertificationAuthority -ComputerName $CN|Get-IssuedRequest -Filter "Disposition -eq 20","NotAfter -ge $DT","SerialNumber -eq $SN" -Property "RawCertificate"| %{[IO.File]::WriteAllText("$pathCertIssuedExport\$($_.SerialNumber).cer", $_.RawCertificate)}}
$pathCertSuspendedValidExport contains all valid suspended certificates, so i'm truing to find out if there is any of them that become unrevoked
I've tried to put all filenames in $pathCertSuspendedValidExport in massive by this code:
$SN = @(Get-ChildItem $pathCertSuspendedValidExport -Name -exclude "DT.txt"|ForEach-Object -process {$_ -replace ".cer"})
But don't know how to compare SerialNumber in filter with every massive value without using foreach.