From 9f8e6746ae7c14d8ce917f3398e3479647d28470 Mon Sep 17 00:00:00 2001 From: Michael T Lombardi Date: Tue, 1 Jun 2021 21:30:47 -0500 Subject: [PATCH] (GH-149) Add long path info to generated readme This commit adds a section clarifying the need for long file path support on systems utilizing the puppetized DSC modules, including help for how to set the values and a link to the Microsoft docs. --- CHANGELOG.md | 3 ++- src/internal/functions/Get-ReadmeContent.ps1 | 21 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7c73cef..3336de48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ability to set generated modules fixtures to something other than the latest released version of `puppetlabs-pwshlib` on the Forge ([#93](https://github.com/puppetlabs/Puppet.Dsc/issues/93)) - A check to `New-PuppetDscModule` which validates that PSRemoting is enabled and errors clearly if not in order to prevent unexpected execution failures later in the process ([#133](https://github.com/puppetlabs/Puppet.Dsc/issues/133)) +- Long file path support information to the requirements section of autogenerated READMEs ([#149](https://github.com/puppetlabs/Puppet.Dsc/issues/149)) ## [0.5.0] - 2021-2-10 @@ -76,7 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial implementation and release -[Unreleased]: https://github.com/puppetlabs/Puppet.Dsc/compare/0.5.0...main +[unreleased]: https://github.com/puppetlabs/Puppet.Dsc/compare/0.5.0...main [0.5.0]: https://github.com/puppetlabs/Puppet.Dsc/releases/tag/0.5.0 [0.4.0]: https://github.com/puppetlabs/Puppet.Dsc/releases/tag/0.4.0 [0.3.0]: https://github.com/puppetlabs/Puppet.Dsc/releases/tag/0.3.0 diff --git a/src/internal/functions/Get-ReadmeContent.ps1 b/src/internal/functions/Get-ReadmeContent.ps1 index 73c2bbcb..aa7d9454 100644 --- a/src/internal/functions/Get-ReadmeContent.ps1 +++ b/src/internal/functions/Get-ReadmeContent.ps1 @@ -51,6 +51,7 @@ function Get-ReadmeContent { $PowerShellGetUri = 'https://github.com/PowerShell/PowerShellGet' $NarrativeDocumentation = 'https://puppetlabs.github.io/iac/news/roadmap/2020/03/30/dsc-announcement.html' $TroubleshootingDocumentation = 'https://github.com/puppetlabs/Puppet.Dsc#troubleshooting' + $MicrosoftLongPathSupportDocs = 'https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later' } Process { @@ -90,6 +91,26 @@ This Puppet module includes two important things: the ruby-pwsh library for runn All of the actual work being done to call the DSC resources vendored with this module is in [this file]($BaseProviderSource) from the `pwshlib` module. This is important for troubleshooting and bug reporting, but doesn't impact your use of the module except that the end result will be that nothing works, as the dependency is not installed alongside this module! +### Long File Path Support + +Several PowerShell modules with DSC Resources end up with _very_ long file paths once vendored, many of which exceed the 260 character limit for file paths. +Luckily in Windows 10 (build 1607+), Windows Server 2016 (build 1607+), and Windows Server 2019 there is now an option for supporting long file paths transparently! + +We **strongly recommend** enabling long file path support on any machines using this module to avoid path length issues. + +You can set this value using the Puppet ``registry_value`` resource: + +``````puppet +registry_value { 'HKLM\System\CurrentControlSet\Control\FileSystem\LongPathsEnabled': + ensure => 'present', + data => [1], + provider => 'registry', + type => 'dword', +} +`````` + +You can also set this value outside of Puppet by [following the Microsoft documentation]($MicrosoftLongPathSupportDocs). + ## Usage You can specify any of the DSC resources from this module like a normal Puppet resource in your manifests.