added function WriteToFile_UTF8NoBOM
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user