PowerShell / PSDscResources

MIT License
129 stars 53 forks source link

Archive: Special Characters not supported in file names within zip files #193

Open ddarwent opened 3 years ago

ddarwent commented 3 years ago

Details of the scenario you tried and the problem that is occurring

When there are special characters in the file name e.g. [char]0x201A these get convert to , ([char]0x00E9) so the filename Tést filenamé.htm in the zip will be called T‚st filenam,.htm when extracted.

Verbose logs showing the problem

Suggested solution to the issue

Support of encoding in the DSC resource.

$enc = [System.Text.Encoding]::GetEncoding(29001) #29001, x-Europa, Europa

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Archive WebsiteZip {
    Destination = "$root\$sitePath\$hostid"
    Path        = "$ArtifactRoot\$PackageFile"
    DependsOn   = "[File]IISRoot"
    Checksum    = "SHA-1"
    Validate    = $true
    Ensure      = "Present"
    Force       = $true
}

The operating system the target node is running

OsName : Microsoft Windows Server 2019 Datacenter OsOperatingSystemSKU : DatacenterServerEdition OsArchitecture : 64 bits WindowsVersion : 1809 WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434 OsLanguage : en-US OsMuiLanguages : {en-US, fr-FR}

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.17763.1490
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1490
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

1.1