dsccommunity / HyperVDsc

This module contains DSC resources for deployment and configuration of Microsoft Hyper-V.
MIT License
114 stars 65 forks source link

VhdFileDirectory - improvements and fixes to Content files #179

Open DmitryMashkov-DM opened 4 years ago

DmitryMashkov-DM commented 4 years ago

Pull Request (PR) description

  1. Added ContentEncoding property to properly support Content files (otherwise they are always written as Unicode) which corrupts some content types like UTF-8 XMLs.
  2. Content files are not tested with ItemHasChanged (this didn't work anyway).
  3. Fixed GetItemToCopy where an undefined DefaultValues array was used instead of DesiredProperties, resulting in a dead code, impacting properties like Force.
  4. After #3 is fixed and the code is finally execuded, it would crash if a file is a Content (without SourcePath).
  5. In SetVHDFile , Copy-Item's ErrorAction is set to Stop. Otherwise, the resource would simply ignore all errors and produce invalid configuration.

This Pull Request (PR) fixes the following issues

None


This change is Reviewable

codecov[bot] commented 4 years ago

Codecov Report

Merging #179 into dev will decrease coverage by <1%. The diff coverage is 0%.

Impacted file tree graph

@@         Coverage Diff         @@
##            dev   #179   +/-   ##
===================================
- Coverage    73%    73%   -1%     
===================================
  Files        11     11           
  Lines      1401   1402    +1     
===================================
  Hits       1035   1035           
- Misses      366    367    +1
aromano2 commented 4 years ago

Hi Dmitry, can you please open an issue for this feature so that we have more context? Also, could you add appropriate tests for the new functionality please? Thanks for the contribution!

johlju commented 2 years ago

We have renamed the resource, removing 'x', so please rebase this PR.