Question variable

Plus d'informations
il y a 2 ans 4 mois #31537 par thomas
variable a été créé par thomas
rebonjour, je cherche a faire une variable qui prends le résultats du matches de cette commande :
$monresultat = Select-String -Path C:\Users\tdewilde\Music\EGA2665933.txt.txt -Pattern 'DECGA1' | Format-List
($monresultat).count
j'ai essayé avec cette commande:
$var1 = $monresultat
mais ça m'affiche la ligne alors que je voudrais que ça me mets le résultats
Pièces jointes :

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

Plus d'informations
il y a 2 ans 4 mois #31539 par Kermit80
Réponse de Kermit80 sur le sujet variable
Remplace $var1 = $monresultat
par $var1 = ($monresultat).count puis appelle ta varible $var1 et t'auras ton résultat

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

Plus d'informations
il y a 2 ans 4 mois #31540 par thomas
Réponse de thomas sur le sujet variable
un gros merci a toi

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

Plus d'informations
il y a 2 ans 4 mois #31541 par thomas
Réponse de thomas sur le sujet variable
une dernière question normalement comment on fait pour sélectionner plusieurs fichiers par ce que j'ai environ 22 000 a faire et je peux pas les faire un par un

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

Plus d'informations
il y a 2 ans 4 mois #31543 par Kermit80
Réponse de Kermit80 sur le sujet variable
Comme indiqué au départ, si tu ne spécifie pas un fichier en particulier comme ceci :
Select-String -Path c:\*.txt -Pattern 'toto' | Format-List
il prendra en compte TOUT les fichiers de type *.txt présent dans c:\ et cherchera le mot-clé...

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

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