jeudi 28 mars 2019

IF contains more than one string do "this" else "this"

trying to make a script that request more info (group Id) if there are SCOM-groups with identical names:

function myFunction {

[cmdletbinding()]

    param(

        [parameter(Mandatory=$true)]

        [string[]]$ObjectName

        )

 

foreach($o in $ObjectName)

 

    {

        $p = Get-SCOMGroup -DisplayName "$o" | select DisplayName

       

        <#

        if($p contains more than one string){"Request group Id"}

        else{"do this"}

        #>            

    }

}

Need help with the functionality in the commentblock

Aucun commentaire:

Enregistrer un commentaire