I try to simply pass two parameters to a powershell function. The seccond parameter $args keeps being empty in the function. What am I missing?
$t= "wi-fi Adapter"
if (multilike $t "*wi-fi*,*wireless*,*wan miniport*" ) {
Write-Host "True"
}
function multilike($text, $args) {
foreach ($arg in $args.split) {
if ($text -like $arg) {return $true}
}
return $false
}
$args.split->$args.split(), although you might want to use a variable name other thanargs