Skript bearbeiten|Remove
# NAME: Convert-Encoding.ps1 
# AUTHOR: Stefan Roth / stefanroth.net 
# DATE:18.01.2015 
  Converts files in SourcePath to UTF-8 Encoding 
  Script converts all files in SourcePath recursevly to UTF-8 and saves them in DestinatioPath 
   .\Convert-Encoding.ps1 -SourcePath D:\Temp -DestinationPath D:\ConvertedFiles -Encoding utf8 
   Be aware that the scripts gets all files recursively starting from the SourcePath!! 
Param ( 
    $Files = Get-ChildItem $SourcePath -Recurse -File 
        If ($Files.Count -gt 0){ 
            If (!($DestinationPath.Substring($DestinationPath.Length - 1) -eq "\")) { 
                $DestinationPath = $DestinationPath + "\" + $Files[0].Directory.Name + "\" 
            Else { 
                $DestinationPath = $DestinationPath + $Files[0].Directory.Name + "\" 
         If (!(Test-Path -Path $DestinationPath)) {New-Item -ItemType Directory -Path $DestinationPath | Out-Null} 
                ForEach($File in $Files) 
                    Write-Host "Read and Convert $($File.Name)" -ForegroundColor Cyan 
                    Get-Content $File.FullName  | Set-Content -Encoding $Encoding ($DestinationPath + $File.Name) -Force -Confirm:$false 
        Write-Host "Conversion of $($Files.Count) Files to $Encoding in $DestinationPath completed" -ForegroundColor Green 
        Write-Host "Source-Directory empty or invalid SourcePath." -ForegroundColor Red 

This script copies and converts all files in source directory recursively to the destination directory and sets the encoding to UTF-8. The source file will not be touched or changed. Some tools require a certain file encoding especially when it comes to special characters. Please check this blog post on my blog http://stefanroth.net/2015/01/16/sma-sma-runbook-toolkit-smart-watch-the-encoding