Моему приложению Azure Service Fabric иногда требуются пути длиннее MAX_PATH, особенно с учетом длины рабочего каталога. Поэтому я хотел бы включить длинные пути к файлам (через значение LongPathsEnabled реестра, через групповую политику или через какой-либо другой механизм, см. https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing) . Но я не могу понять, как это сделать.
Кластер работает на Azure VMSS, поэтому я могу удаленно подключаться к отдельным экземплярам и настраивать его вручную, но это, конечно, плохо масштабируется.
ОБНОВИТЬ:
Ответ @ 4c74356b41 дал мне большую часть того, где мне нужно было быть. В моем VMSS уже было установлено расширение customScript, поэтому мне пришлось изменить его, чтобы включить команду PS, вот моя последняя команда:
# Get the existing VMSS configuration
$vmss = Get-AzVmss -ResourceGroupName <resourceGroup> -Name <vmss>
# inspect $vmss to determine which extension is the customScript, in ours it's at index 3. Note the existing commandToExecute blob, you'll need to modify it to add the additional PS command
# modify the existing Settings.commandToExecute blob to add the reg set command
$vmss.VirtualMachineProfile.ExtensionProfile.Extensions[3].Settings.commandToExecute = 'powershell -ExecutionPolicy Unrestricted -File AzureQualysCloudAgentPowerShell_v2.ps1 && powershell -c "Set-ItemProperty -Path HKLM:\System\ControlSet001\Control\FileSystem -Name LongPathsEnabled -Value 1"'
# update the VMSS with the new config
Update-AzVmss -ResourceGroupName $vmss.ResourceGroupName -Name $vmss.Name -VirtualMachineScaleSet $vmss