Question Problème concaténation de chaine

Plus d'informations
il y a 14 ans 3 mois #10636 par zabimaru27
bonjour je cherche à concaténer deux variables de type sting

Voici mon code
[code:1]
$temp = $_.properties.cn + \"#\" + $_.properties.info
$temp
$temp >> Test.txt
[/code:1]

Leproblème est que le résultat est de ce type :

Champ1
#
champ2


comment empecher les retour chariots ??

Merci d'avance pour vos éclaircissements

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 14 ans 3 mois #10640 par Richard Lazaro
Bonjour,

Car je suppose que tu sors tes informations depuis l'ADSI.
Or les valeurs que tu requêtes retourne un tableau, tu peux le voir grâce à :
[code:1]$_.properties.cn.GetType()[/code:1]

Ce tableau n'a qu'une seule case.

Donc voici ce que cela donne :

[code:1]
$temp = $_.properties.cn[0] + \"#\" + $_.properties.info[0]
$temp
[/code:1]

Bien cordialement,
Richard Lazaro.

Think-MS : (Get-Life).Days | %{ Learn-More }

\\"Problems cannot be solved by the same level of thinking that created them.\\" - Albert Einstein

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 14 ans 3 mois #10644 par zabimaru27
Merci beaucoup.

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.079 secondes
Propulsé par Kunena