Connexion
Microsoft.com
France (Français)
Brasil (Português)
Česká republika (Čeština)
Deutschland (Deutsch)
España (Español)
Italia (Italiano)
United States (English)
Россия (Русский)
대한민국 (한국어)
中华人民共和国 (中文)
台灣 (中文)
日本 (日本語)
香港特别行政區 (中文)
Pour les professionnels de l’informatique
Accueil
Library
Formation
Téléchargements
Support technique
Communautés
Forums
Pour les professionnels de l’informatique
>
Forums - Accueil
>
Windows PowerShell
>
redirection of output?
Poser une question
Rechercher dans les forums :
Rechercher dans le forum Windows PowerShell
Rechercher dans tous les forums Microsoft TechNet
redirection of output?
mercredi 24 juin 2009 12:50
Tim Estenson
0
Connectez-vous pour voter
I am running a command executible by calling:
$command = some.exe < a bunch of parameters>
invoke-expression $command
If i pipe the output to files like this:
invoke-expression $command 2>foo.txt >bar.txt
errors go to foo.txt and regular output goes to bar.txt. now if I do this:
invoke-expression $command 2>&1>bar.txt
I expect both errors and output to be interlaced into the same file. However in reality the errors are completly lost. Is this a bug?
It seems like Tee-Object should have an option to also grab errors? what I would like to do is
invoke-expression $command | Tee-object -var $foo
then use $foo to try and recover from issues.
Réponse
Citation
Réponses
jeudi 25 juin 2009 19:01
Marco Shaw
MVP
, Modérateur
0
Connectez-vous pour voter
Known bug...
You'll have to do this:
(invoke-expression $command) 2>&1>bar.txt
Tee isn't designed to capture an error stream.
Marqué comme réponse
Marco Shaw
MVP
, Modérateur
jeudi 25 juin 2009 19:01
Réponse
Citation
Toutes les réponses
mercredi 24 juin 2009 16:15
Marco Shaw
MVP
, Modérateur
0
Connectez-vous pour voter
Not sure what version of PowerShell you're trying...
I tried with v2 CTP3 and it still doesn't work...
I'll ask around. I don't find anything related in Microsoft Connect.
Réponse
Citation
jeudi 25 juin 2009 19:01
Marco Shaw
MVP
, Modérateur
0
Connectez-vous pour voter
Known bug...
You'll have to do this:
(invoke-expression $command) 2>&1>bar.txt
Tee isn't designed to capture an error stream.
Marqué comme réponse
Marco Shaw
MVP
, Modérateur
jeudi 25 juin 2009 19:01
Réponse
Citation
Besoin d'aide sur les forums ? (Forum aux questions)
© 2009 Microsoft Corporation. Tous droits réservés.
Gérer votre profil
|
Contactez-nous
|
Newsletter
|
Conditions d'utilisation
|
Marques
|
Confidentialité