Describe the bug
The Set-ModuleReadMe script fails when using the split function and its quotation (e.g. split(abc, '/')) in line 746: $paramInJsonFormatObject = $paramInJSONFormatArray | Out-String | ConvertFrom-Json -AsHashtable -Depth 99 -ErrorAction 'Stop' .
To reproduce
If you have a parameter such as
diagnosticsStorageAccountConfig: {
blobEndpoint: 'https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))}.blob.${environment().suffixes.storage}/'
protectedAccountKeyName: 'StorageAccountKey1'
queueEndpoint: 'https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))}.queue.${environment().suffixes.storage}/'
storageAccountName: last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))
tableEndpoint: 'https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, '/'))}.table.${environment().suffixes.storage}/'
}
and run the Set-ModuleReadMe function, it will fail. The 'formatted JSON' looks like the following:
"diagnosticsStorageAccountConfig": {
"blobEndpoint": "https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, "/"))}.blob.${environment().suffixes.storage}/",
"protectedAccountKeyName": "StorageAccountKey1",
"queueEndpoint": "https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, "/"))}.queue.${environment().suffixes.storage}/",
"storageAccountName": "<storageAccountName>",
"tableEndpoint": "https://${last(split(resourceGroupResources.outputs.storageAccountResourceId, "/"))}.table.${environment().suffixes.storage}/"
}
Relevant log output
You can use the branch 'users/elbatane/UpdateServiceFabricClusters_alsehr' for troubleshooting
Describe the bug
The
Set-ModuleReadMescript fails when using the split function and its quotation (e.g.split(abc, '/')) in line746:$paramInJsonFormatObject = $paramInJSONFormatArray | Out-String | ConvertFrom-Json -AsHashtable -Depth 99 -ErrorAction 'Stop'.To reproduce
If you have a parameter such as
and run the
Set-ModuleReadMefunction, it will fail. The 'formatted JSON' looks like the following:Relevant log output