22 lines
441 B
PowerShell
22 lines
441 B
PowerShell
function Repair-ConfigurationDataPathEncoding {
|
|
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory=$true)]
|
|
[AllowEmptyString()]
|
|
[string]
|
|
$Path
|
|
)
|
|
|
|
if($Path -notmatch "[ÃÂ]"){
|
|
return $Path
|
|
}
|
|
|
|
try {
|
|
$Bytes = [System.Text.Encoding]::GetEncoding(1252).GetBytes($Path)
|
|
return [System.Text.Encoding]::UTF8.GetString($Bytes)
|
|
}
|
|
catch {
|
|
return $Path
|
|
}
|
|
}
|