Update module version to 1.0.1 and add new functions for exporting and deploying DSC configuration data
This commit is contained in:
21
Private/Repair-ConfigurationDataPathEncoding.ps1
Normal file
21
Private/Repair-ConfigurationDataPathEncoding.ps1
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user