1 输出重定向

>  或者>>

2 输出控制

out-* -paging#分页输出

get-process | out-host -paging

more指令用于屏显

 

get-process | out-printer #发送到默认打印机,打印内容

get-process | out-printer  命令打印输出信息

 

利用out-file命令将信息输出到文件。

可以看出,上面的   get-process | out-file process.txt 命令确实创建了文件。

  有一点需要注意: out-file命令创建的是Unicode编码的文件,有时候为了输出ASCII编码的文件,我们需要增加-encoding参数, 从而控制输出的文本编码格式

 

get-process | out-file -encoding ascii -filepath .\process1.txt

 

相关文章:

  • 2022-12-23
  • 2021-04-21
  • 2021-05-25
  • 2022-12-23
  • 2021-07-22
  • 2022-01-22
  • 2021-11-01
  • 2021-07-10
猜你喜欢
  • 2021-05-27
  • 2021-08-28
  • 2021-08-11
  • 2022-02-26
  • 2021-11-12
  • 2022-12-23
  • 2021-05-21
相关资源
相似解决方案