惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
罗磊的独立博客
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
博客园 - 聂微东
博客园_首页
爱范儿
爱范儿
量子位
博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Martin Fowler
Martin Fowler
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Y
Y Combinator Blog
Vercel News
Vercel News
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
Engineering at Meta
Engineering at Meta

博客园 - 挖土.

学笛子 PowerShell: Try...Catch...Finally 实现方法 How to set the compuder to auto login 让 PowerShell 2.0 支持 DotNet FrameWork 4.0 用 Powershell 安装Dotnet FrameWorrk 4.0 PowerShell 调用.netFramework中的静态函数 PowerGUI Visual Studio is now in beta! PowerShell 中定义和使用泛型 PowerShell 如何引用DLL 给string加几个扩展方法 加快 c++ Builder 5编译速度 Windows 7 下的 SUBST 命令 How to configure the BDE for Windows Vista/7 - 挖土. Linker problems with Borland builder SQL 中的中位值计算 Windows 7的“上帝模式” XML 序列化和反序列化详例代码 给存储过程传递一个表 VSIdeTesthost installation issue - 挖土.
PowerShell中Add-Content 和 Out-File 的区别
挖土. · 2010-07-29 · via 博客园 - 挖土.

Add-Content 输出 ASCII 格式

Out-File 默认输出 Unicode 格式, 可以使用 -Encoding ASCII来指定编码方式。

执行以下命令,然后查看三个文件的格式。

1 Add-Content "D:\testA.txt" "ASCII Format Only"
2 
3 Out-File -FilePath "D:\TestB.txt" -Append -InputObject "Default, file format is Unicode"
4 
5 Out-File -FilePath "D:\TestC.txt" -Append -Encoding ASCII -InputObject "Now, file format is ASCII."