Long paths in Windows

Trying to kitchen converge using Chef's own CIS remediation "canned" code, and I get the following failures due to the 260-character limit in Windows. I have already tried "git config --global core.longpaths true", and I've used Group Poilcy to enable long paths. How can I fix this? Thanks!

   Exporting cookbook dependencies from Policyfile C:/Users/MATT~1.HOH/AppData/Local/Temp/default-Win2019Datacenter-sandbox-20230509-14344-r6j3it using `C:\opscode\chef-workstation\bin\chef-cli.BAT export`...
   Error: Failed to export policy (in C:/Users/matt.hohmeister/azurerepo/remediation_cis_microsoft_iis_10_v_1_1_1/Policyfile.rb) to C:/Users/MATT~1.HOH/AppData/Local/Temp/default-Win2019Datacenter-sandbox-20230509-14344-r6j3it
   Reason: (Errno::ENOENT) No such file or directory @ rb_sysopen - C:/Users/MATT~1.HOH/AppData/Local/Temp/chefcli-export-10344-2023050915531720230509-10344-3gryd0/cookbook_artifacts/remediation_cis_microsoft_iis_10_v_1_1_1-776951c0d6e5e133fd58e3fd904c4e11078a4d40/files/default/CIS_Microsoft_IIS_10_v_1_1_1/CIS_Microsoft_IIS_10_1_1.rb

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #converge action: [Expected process to exit with [0], but received '1'
---- Begin output of C:\opscode\chef-workstation\bin\chef-cli.BAT export C:/Users/matt.hohmeister/azurerepo/remediation_cis_microsoft_iis_10_v_1_1_1/Policyfile.rb C:/Users/MATT~1.HOH/AppData/Local/Temp/default-Win2019Datacenter-sandbox-20230509-14344-r6j3it --force ----
STDOUT:
STDERR: Error: Failed to export policy (in C:/Users/matt.hohmeister/azurerepo/remediation_cis_microsoft_iis_10_v_1_1_1/Policyfile.rb) to C:/Users/MATT~1.HOH/AppData/Local/Temp/default-Win2019Datacenter-sandbox-20230509-14344-r6j3it
Reason: (Errno::ENOENT) No such file or directory @ rb_sysopen - C:/Users/MATT~1.HOH/AppData/Local/Temp/chefcli-export-10344-2023050915531720230509-10344-3gryd0/cookbook_artifacts/remediation_cis_microsoft_iis_10_v_1_1_1-776951c0d6e5e133fd58e3fd904c4e11078a4d40/files/default/CIS_Microsoft_IIS_10_v_1_1_1/CIS_Microsoft_IIS_10_1_1.rb
---- End output of C:\opscode\chef-workstation\bin\chef-cli.BAT export C:/Users/matt.hohmeister/azurerepo/remediation_cis_microsoft_iis_10_v_1_1_1/Policyfile.rb C:/Users/MATT~1.HOH/AppData/Local/Temp/default-Win2019Datacenter-sandbox-20230509-14344-r6j3it --force ----
Ran C:\opscode\chef-workstation\bin\chef-cli.BAT export C:/Users/matt.hohmeister/azurerepo/remediation_cis_microsoft_iis_10_v_1_1_1/Policyfile.rb C:/Users/MATT~1.HOH/AppData/Local/Temp/default-Win2019Datacenter-sandbox-20230509-14344-r6j3it --force returned 1] on default-Win2019Datacenter

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

Hi @mahohmei what version of Chef Workstation are you using? Could you please try out the more recent 23.5.1040? We have fixed the issue with Windows longpath limitation when running chef export, as is evident in the logs above where test-kitchen run involves running the command.

I have upgraded my version of Chef Workstation to 23.5.1040, and while kitchen converge no longer errors out, I'm having something different happen:

Exporting cookbook dependencies from Policyfile C:/Users/MATT~1.HOH/AppData/Local/Temp/default-Win2019Datacenter-sandbox-20230613-18464-lexwyq using C:\opscode\chef-workstation\bin\chef-cli.BAT export...

This results in files being placed in a temporary holding location of "C:\Users\matt.hohmeister\AppData\Local\Temp\default-Win2019Datacenter-sandbox-20230613-18464-lexwyq\cookbook_artifacts\remediation_cis_microsoft_iis_10_v_1_1_1-8ddc7435805748208356bd2efbdcca274ba81c73\files\default\CIS_Microsoft_IIS_10_v_1_1_1\scripts", which is 252 characters long. As all the filenames are >8 characters long, that breaks 260. The end result is that this entire folder fails to get copied into C:\chef\cache on the test kitchen VM, and the files are this not available.

Now, if I browse on my workstation's Windows file system to C:\Users\matt.hohmeister\AppData\Local\Temp\default-Win2019Datacenter-sandbox-20230613-18464-lexwyq\cookbook_artifacts\remediation_cis_microsoft_iis_10_v_1_1_1-8ddc7435805748208356bd2efbdcca274ba81c73\files\default\CIS_Microsoft_IIS_10_v_1_1_1\scripts, the folder is sure enough full of the intended scripts.

How can I workaround or fix this?

Thanks!