Bonjour,
J'ai un problème pour un script. Mon script construit une chaine de caractère stocké dans une variable que je souhaite faire passer en dans une commande par la suite.
Par exemple:
$variable = $_.path.StartsWith($server1)
Ensuite j'appelle cette variable dans une commande. $objet | where $variable
Mais impossible il me met value of type "System.String" to type Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "$_.path.StartsWith($server1) "System.Management.Automation.ScriptBlock".
J'ai essayer plein de chose mais je reste bloqué
Partager