#* FileName: convert-encoding.ps1
#*=============================================================================
#* Script Name: [convert-encoding]
#* Version 1.0
#* Created:
#* Author: Shi Cheng
#* Company: PUMCH
#* Email: shicheng@live.com
#* Web: http://orca2007.spaces.live.com
#* Reqrmnts:
#* Keywords:
#*=============================================================================
#* Purpose: text encoding format convert
#*
#*
#*=============================================================================
#*input the directory that documents in there want to converting
$path = $args[0]
$items=Get-ChildItem $path -Recurse -Force -Include *.txt
foreach ($item in $items)
{
$path=Join-Path $item.Directory $item.name
$content=get-content $path
Remove-Item $path
$content |out-file -filepath $path -encoding Unicode
}
下一篇:环境变量入门