-2

Tried using '>' and 'OUT' commands but it is writing different output to the file that is not appearing in power shell window. Please note that these commands are application specific.

2 Answers2

0

You can assign any output to a variable like below
$output = dir

TechBug
  • 11
  • 4
0

> will only redirect stdout (also called "success stream"). If you want to redirect all possible streams, use *>.

You can read more about redirection here.

stackprotector
  • 10,498
  • 4
  • 35
  • 64
  • Thanks for your comment. I tried as you mentioned but still it is capturing output not appearing on power shell window. Using *> just increased the lines of output in this case. – Sudhakar Kumar Jun 05 '20 at 05:16
  • @SudhakarKumar Please add your code, your current result and your expected result to your question as Alex_P already requested. – stackprotector Jun 05 '20 at 08:29