I played around with parameters and I ran into a problem.
function sign-script {
param(
[Parameter(
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
Position = 0,
Mandatory = $true
)]
[ValidateNotNullOrEmpty()]
[Alias('FullName')]
[string[]]$scripts,
[string]$certname = "codesigning",
[string]$certstore = "Cert:\LocalMachine\My"
)
Write-Host $scripts.count
}
If I run this function like this:
"Z:\test\test-sign.ps1","Z:\test\test-sign - Kopie (7).ps1" | sign-script
$scripts.count returns 1, instead of 2, why? Is the function not processing all values, or is it only accepting one value?