diff --git a/Tools.ps1 b/Tools.ps1 index a174759..d67c0fd 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -723,5 +723,16 @@ function Get-FileSizes { LogMsg $logstr } +# Function to write text to a file in UTF8 encoding without BOM +function WriteToFile_UTF8NoBOM { + param( + [Parameter(ValueFromPipeline=$false)][string]$FilePath, + [Parameter(ValueFromPipeline=$true)][string]$Value + ) + $UTF8NoBOM = New-Object System.Text.UTF8Encoding $false + Try { [IO.File]::WriteAllText($FilePath, $CONFIG, $UTF8NoBOM) } + Catch { LogErr $_.Exception.Message } +} + Setup-MSPDirectories Setup-LogFile \ No newline at end of file