"
- }
- ]
}
}
}
diff --git a/avm/res/network/private-dns-zone/cname/README.md b/avm/res/network/private-dns-zone/cname/README.md
index cee461a947..de536f01bf 100644
--- a/avm/res/network/private-dns-zone/cname/README.md
+++ b/avm/res/network/private-dns-zone/cname/README.md
@@ -44,7 +44,7 @@ This module deploys a Private DNS Zone CNAME record.
A CNAME record.
- Required: No
- Type: object
-- Default: `{object}`
+- Default: `{}`
### Parameter: `metadata`
diff --git a/avm/res/network/private-endpoint/README.md b/avm/res/network/private-endpoint/README.md
index 0f8b2df8e5..abc80d4a20 100644
--- a/avm/res/network/private-endpoint/README.md
+++ b/avm/res/network/private-endpoint/README.md
@@ -25,7 +25,7 @@ The following section provides usage examples for the module, which were used to
>**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.
->**Note**: To reference the module, please use the following syntax `br/public:avm-res-network-privateendpoint:1.0.0`.
+>**Note**: To reference the module, please use the following syntax `br/public:avm/res/network/private-endpoint:0.2.0`.
- [Using only defaults](#example-1-using-only-defaults)
- [Using large parameter set](#example-2-using-large-parameter-set)
@@ -43,7 +43,7 @@ This instance deploys the module with the minimum set of required parameters.
via Bicep module
```bicep
-module privateEndpoint 'br/public:avm-res-network-privateendpoint:1.0.0' = {
+module privateEndpoint 'br/public:avm/res/network/private-endpoint:0.2.0' = {
name: '${uniqueString(deployment().name, location)}-test-npemin'
params: {
// Required parameters
@@ -147,7 +147,7 @@ This instance deploys the module with most of its features enabled.
via Bicep module
```bicep
-module privateEndpoint 'br/public:avm-res-network-privateendpoint:1.0.0' = {
+module privateEndpoint 'br/public:avm/res/network/private-endpoint:0.2.0' = {
name: '${uniqueString(deployment().name, location)}-test-npemax'
params: {
// Required parameters
@@ -303,7 +303,7 @@ This instance deploys the module in alignment with the best-practices of the Wel
via Bicep module
```bicep
-module privateEndpoint 'br/public:avm-res-network-privateendpoint:1.0.0' = {
+module privateEndpoint 'br/public:avm/res/network/private-endpoint:0.2.0' = {
name: '${uniqueString(deployment().name, location)}-test-npewaf'
params: {
// Required parameters
diff --git a/avm/res/network/private-endpoint/main.bicep b/avm/res/network/private-endpoint/main.bicep
index 9955227238..2c5fa720ab 100644
--- a/avm/res/network/private-endpoint/main.bicep
+++ b/avm/res/network/private-endpoint/main.bicep
@@ -165,7 +165,7 @@ type roleAssignmentType = {
principalId: string
@description('Optional. The principal type of the assigned principal ID.')
- principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device' | null)?
+ principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?
@description('Optional. The description of the role assignment.')
description: string?
diff --git a/avm/res/network/private-endpoint/main.json b/avm/res/network/private-endpoint/main.json
index d0d8b2fe71..f345888eb2 100644
--- a/avm/res/network/private-endpoint/main.json
+++ b/avm/res/network/private-endpoint/main.json
@@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
- "version": "0.21.1.54444",
- "templateHash": "13152465847704433697"
+ "version": "0.23.1.45101",
+ "templateHash": "2788827530274342759"
},
"name": "Private Endpoints",
"description": "This module deploys a Private Endpoint.",
@@ -345,8 +345,8 @@
"metadata": {
"_generator": {
"name": "bicep",
- "version": "0.21.1.54444",
- "templateHash": "1698104586574073002"
+ "version": "0.23.1.45101",
+ "templateHash": "18168683629401652671"
},
"name": "Private Endpoint Private DNS Zone Groups",
"description": "This module deploys a Private Endpoint Private DNS Zone Group.",
diff --git a/avm/res/network/private-endpoint/private-dns-zone-group/main.json b/avm/res/network/private-endpoint/private-dns-zone-group/main.json
index f1c059b02a..1ace60b310 100644
--- a/avm/res/network/private-endpoint/private-dns-zone-group/main.json
+++ b/avm/res/network/private-endpoint/private-dns-zone-group/main.json
@@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
- "version": "0.21.1.54444",
- "templateHash": "1698104586574073002"
+ "version": "0.23.1.45101",
+ "templateHash": "18168683629401652671"
},
"name": "Private Endpoint Private DNS Zone Groups",
"description": "This module deploys a Private Endpoint Private DNS Zone Group.",
diff --git a/avm/res/network/private-endpoint/version.json b/avm/res/network/private-endpoint/version.json
index 7fa401bdf7..9481fea58e 100644
--- a/avm/res/network/private-endpoint/version.json
+++ b/avm/res/network/private-endpoint/version.json
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
- "version": "0.1",
+ "version": "0.2",
"pathFilters": [
"./main.json"
]
diff --git a/avm/res/network/public-ip-address/README.md b/avm/res/network/public-ip-address/README.md
index 6c0a17b265..5139ea103d 100644
--- a/avm/res/network/public-ip-address/README.md
+++ b/avm/res/network/public-ip-address/README.md
@@ -25,7 +25,7 @@ The following section provides usage examples for the module, which were used to
>**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.
->**Note**: To reference the module, please use the following syntax `br/public:avm-res-network-publicipaddress:1.0.0`.
+>**Note**: To reference the module, please use the following syntax `br/public:avm/res/network/public-ip-address:0.1.1`.
- [Using only defaults](#example-1-using-only-defaults)
- [Using large parameter set](#example-2-using-large-parameter-set)
@@ -43,7 +43,7 @@ This instance deploys the module with the minimum set of required parameters.
via Bicep module
```bicep
-module publicIpAddress 'br/public:avm-res-network-publicipaddress:1.0.0' = {
+module publicIpAddress 'br/public:avm/res/network/public-ip-address:0.1.1' = {
name: '${uniqueString(deployment().name, location)}-test-npiamin'
params: {
// Required parameters
@@ -123,7 +123,7 @@ This instance deploys the module with most of its features enabled.
via Bicep module
```bicep
-module publicIpAddress 'br/public:avm-res-network-publicipaddress:1.0.0' = {
+module publicIpAddress 'br/public:avm/res/network/public-ip-address:0.1.1' = {
name: '${uniqueString(deployment().name, location)}-test-npiamax'
params: {
// Required parameters
@@ -269,7 +269,7 @@ This instance deploys the module in alignment with the best-practices of the Azu
via Bicep module
```bicep
-module publicIpAddress 'br/public:avm-res-network-publicipaddress:1.0.0' = {
+module publicIpAddress 'br/public:avm/res/network/public-ip-address:0.1.1' = {
name: '${uniqueString(deployment().name, location)}-test-npiawaf'
params: {
// Required parameters
@@ -437,7 +437,7 @@ module publicIpAddress 'br/public:avm-res-network-publicipaddress:1.0.0' = {
### Parameter: `ddosSettings`
The DDoS protection plan configuration associated with the public IP address.
-- Required: Yes
+- Required: No
- Type: object
@@ -453,6 +453,15 @@ Required. The DDoS protection plan ID associated with the public IP address.
- Required: Yes
- Type: object
+| Name | Required | Type | Description |
+| :-- | :-- | :--| :-- |
+| [`id`](#parameter-ddossettingsddosprotectionplanid) | Yes | string | |
+
+### Parameter: `ddosSettings.ddosProtectionPlan.id`
+- Required: Yes
+- Type: string
+
+
### Parameter: `ddosSettings.protectionMode`
Required. The DDoS protection policy customizations.
@@ -579,7 +588,7 @@ Optional. Resource ID of the diagnostic log analytics workspace. For security re
### Parameter: `dnsSettings`
The DNS settings of the public IP address.
-- Required: Yes
+- Required: No
- Type: object
@@ -679,7 +688,13 @@ IP address version.
- Required: No
- Type: string
- Default: `'IPv4'`
-- Allowed: `[IPv4, IPv6]`
+- Allowed:
+ ```Bicep
+ [
+ 'IPv4'
+ 'IPv6'
+ ]
+ ```
### Parameter: `publicIPAllocationMethod`
@@ -687,7 +702,13 @@ The public IP address allocation method.
- Required: No
- Type: string
- Default: `'Static'`
-- Allowed: `[Dynamic, Static]`
+- Allowed:
+ ```Bicep
+ [
+ 'Dynamic'
+ 'Static'
+ ]
+ ```
### Parameter: `publicIpPrefixResourceId`
@@ -769,7 +790,13 @@ Name of a public IP address SKU.
- Required: No
- Type: string
- Default: `'Standard'`
-- Allowed: `[Basic, Standard]`
+- Allowed:
+ ```Bicep
+ [
+ 'Basic'
+ 'Standard'
+ ]
+ ```
### Parameter: `skuTier`
@@ -777,7 +804,13 @@ Tier of a public IP address SKU.
- Required: No
- Type: string
- Default: `'Regional'`
-- Allowed: `[Global, Regional]`
+- Allowed:
+ ```Bicep
+ [
+ 'Global'
+ 'Regional'
+ ]
+ ```
### Parameter: `tags`
diff --git a/avm/utilities/pipelines/publish/Publish-ModuleFromPathToPBR.ps1 b/avm/utilities/pipelines/publish/Publish-ModuleFromPathToPBR.ps1
index 6db4eadc0a..1f5fc4a5c0 100644
--- a/avm/utilities/pipelines/publish/Publish-ModuleFromPathToPBR.ps1
+++ b/avm/utilities/pipelines/publish/Publish-ModuleFromPathToPBR.ps1
@@ -93,5 +93,7 @@ function Publish-ModuleFromPathToPBR {
'--force'
)
# TODO move to its own task to show that as skipped if no file qualifies for new version
+ Write-Verbose "Publish Input:`n $($publishInput | ConvertTo-Json -Depth 10)" -Verbose
+
bicep publish @publishInput
}
diff --git a/avm/utilities/pipelines/publish/helper/Get-BRMRepositoryName.ps1 b/avm/utilities/pipelines/publish/helper/Get-BRMRepositoryName.ps1
index f58cf2d4e8..5c96743a75 100644
--- a/avm/utilities/pipelines/publish/helper/Get-BRMRepositoryName.ps1
+++ b/avm/utilities/pipelines/publish/helper/Get-BRMRepositoryName.ps1
@@ -11,7 +11,7 @@ Mandatory. The template file path to convert
.EXAMPLE
Get-BRMRepositoryName -TemplateFilePath 'C:\avm\res\key-vault\vault\main.bicep'
-Convert 'C:\avm\res\key-vault\vault\main.bicep' to e.g. 'avm-res-keyvault-vault'
+Convert 'C:\avm\res\key-vault\vault\main.bicep' to e.g. 'avm/res/key-vault/vault'
#>
function Get-BRMRepositoryName {
@@ -21,8 +21,6 @@ function Get-BRMRepositoryName {
[string] $TemplateFilePath
)
- $moduleIdentifier = ((Split-Path $TemplateFilePath -Parent) -split '[\/|\\]avm[\/|\\]')[-1]
- $formattedModuleIdentifier = ($moduleIdentifier -replace '-', '') -replace '[\/|\\]', '-'
-
- return "avm-$formattedModuleIdentifier"
+ $moduleIdentifier = (Split-Path $TemplateFilePath -Parent) -split '[\/|\\](avm[\/|\\])'
+ return ($moduleIdentifier[1, 2] -join '') -replace '\\', '/'
}
diff --git a/avm/utilities/pipelines/publish/helper/Get-ModuleTargetPatchVersion.ps1 b/avm/utilities/pipelines/publish/helper/Get-ModuleTargetPatchVersion.ps1
index a997d63973..42f8c2c45c 100644
--- a/avm/utilities/pipelines/publish/helper/Get-ModuleTargetPatchVersion.ps1
+++ b/avm/utilities/pipelines/publish/helper/Get-ModuleTargetPatchVersion.ps1
@@ -40,15 +40,14 @@ function Get-ModuleTargetPatchVersion {
$ModuleRelativeFolderPath = ("avm/{0}" -f ($ModuleFolderPath -split '[\/|\\]avm[\/|\\]')[-1]) -replace '\\', '/'
- # Get all released module tags
- $existingTagList = git ls-remote --tag origin "$ModuleRelativeFolderPath/$MajMinVersion*"
+ # Get all released module tags (using upstream specifically to work in forks)
+ $existingTagList = git ls-remote --tag 'https://github.com/Azure/bicep-registry-modules.git' "$ModuleRelativeFolderPath/$MajMinVersion*"
if ( $existingTagList.count -eq 0 ) {
# If first module tag, reset patch
Write-Verbose "No existing tag for module [$ModuleRelativeFolderPath] starting with version [$MajMinVersion]" -Verbose
Write-Verbose "Setting patch version to 0" -Verbose
$patch = 0
- }
- else {
+ } else {
# Otherwise get latest patch
$patchList = $existingTagList | ForEach-Object { [int](($_ -split '\.')[-1]) }
$latestPatch = ($patchList | Measure-Object -Maximum).Maximum
diff --git a/avm/utilities/pipelines/publish/helper/Get-ModuleVersionChange.ps1 b/avm/utilities/pipelines/publish/helper/Get-ModuleVersionChange.ps1
index b8b739302c..fc8458c772 100644
--- a/avm/utilities/pipelines/publish/helper/Get-ModuleVersionChange.ps1
+++ b/avm/utilities/pipelines/publish/helper/Get-ModuleVersionChange.ps1
@@ -43,16 +43,11 @@ function Get-ModuleVersionChange {
$newVersion = (New-Object System.Version($matches[1], $matches[2]))
}
- Write-Verbose "The old version is [$oldVersion]" -Verbose
- Write-Verbose "The new version is [$newVersion]" -Verbose
-
if ($newVersion -lt $oldVersion) {
Write-Verbose "The new version is smaller than the old version"
- }
- elseif ($newVersion -eq $oldVersion) {
+ } elseif ($newVersion -eq $oldVersion) {
Write-Verbose "The new version equals the old version"
- }
- else {
+ } else {
Write-Verbose "The new version is greater than the old version"
}
diff --git a/avm/utilities/pipelines/sharedScripts/Set-ModuleReadMe.ps1 b/avm/utilities/pipelines/sharedScripts/Set-ModuleReadMe.ps1
index 3f3efc1535..1b5f8ce429 100644
--- a/avm/utilities/pipelines/sharedScripts/Set-ModuleReadMe.ps1
+++ b/avm/utilities/pipelines/sharedScripts/Set-ModuleReadMe.ps1
@@ -226,39 +226,64 @@ function Set-ParametersSection {
# 3. Add individual parameters
foreach ($parameter in $categoryParameters) {
+
+ $isRequired = Get-IsParameterRequired -TemplateFileContent $TemplateFileContent -Parameter $parameter
+
+ # Default values
+ if ($parameter.defaultValue -is [array]) {
+ if ($parameter.defaultValue.count -eq 0) {
+ $defaultValue = '[]'
+ } else {
+ $bicepJSONDefaultParameterObject = @{ $parameter.name = ($parameter.defaultValue ?? @()) } # Wrapping on object to work with formatted Bicep script
+ $bicepRawformattedDefault = ConvertTo-FormattedBicep -JSONParameters $bicepJSONDefaultParameterObject
+ $leadingSpacesToTrim = ($bicepRawformattedDefault -match '^(\s+).+') ? $matches[1].Length : 0
+ $bicepCleanedFormattedDefault = $bicepRawformattedDefault -replace ('{0}: ' -f $parameter.name) # Unwrapping the object
+ $defaultValue = $bicepCleanedFormattedDefault -split '\n' | ForEach-Object { $_ -replace "^\s{$leadingSpacesToTrim}" } # Removing excess leading spaces
+ }
+ } elseif ($parameter.defaultValue -is [hashtable]) {
+ if ($parameter.defaultValue.count -eq 0) {
+ $defaultValue = '{}'
+ } else {
+ $bicepDefaultValue = ConvertTo-FormattedBicep -JSONParameters $parameter.defaultValue
+ $defaultValue = "{`n$bicepDefaultValue`n}"
+ }
+ } elseif ($parameter.defaultValue -is [string] -and ($parameter.defaultValue -notmatch '\[\w+\(.*\).*\]')) {
+ $defaultValue = '''' + $parameter.defaultValue + ''''
+ } else {
+ $defaultValue = $parameter.defaultValue
+ }
+
# User defined type
if ($null -eq $parameter.type -and $parameter.ContainsKey('$ref')) {
$identifier = Split-Path $parameter.'$ref' -Leaf
$definition = $TemplateFileContent.definitions[$identifier]
-
$type = $definition['type']
- $isRequired = (-not $definition['nullable'])
- $defaultValue = $null
$rawAllowedValues = $definition['allowedValues']
} else {
$type = $parameter.type
-
- if ($parameter.defaultValue -is [array]) {
- $defaultValue = '[{0}]' -f (($parameter.defaultValue | Sort-Object) -join ', ')
- } elseif ($parameter.defaultValue -is [hashtable]) {
- $defaultValue = '{object}'
- } elseif ($parameter.defaultValue -is [string] -and ($parameter.defaultValue -notmatch '\[\w+\(.*\).*\]')) {
- $defaultValue = '''' + $parameter.defaultValue + ''''
- } else {
- $defaultValue = $parameter.defaultValue
- }
-
- $isRequired = Get-IsParameterRequired -TemplateFileContent $TemplateFileContent -Parameter $parameter
$rawAllowedValues = $parameter.allowedValues
}
+ # Allowed values
+ if ($rawAllowedValues -is [array]) {
+ $bicepJSONAllowedParameterObject = @{ $parameter.name = ($rawAllowedValues ?? @()) } # Wrapping on object to work with formatted Bicep script
+ $bicepRawformattedAllowed = ConvertTo-FormattedBicep -JSONParameters $bicepJSONAllowedParameterObject
+ $leadingSpacesToTrim = ($bicepRawformattedAllowed -match '^(\s+).+') ? $matches[1].Length : 0
+ $bicepCleanedFormattedAllowed = $bicepRawformattedAllowed -replace ('{0}: ' -f $parameter.name) # Unwrapping the object
+ $allowedValues = $bicepCleanedFormattedAllowed -split '\n' | ForEach-Object { $_ -replace "^\s{$leadingSpacesToTrim}" } # Removing excess leading spaces
+ } elseif ($rawAllowedValues -is [hashtable]) {
+ $bicepAllowedValues = ConvertTo-FormattedBicep -JSONParameters $rawAllowedValues
+ $allowedValues = "{`n$bicepAllowedValues`n}"
+ } else {
+ $allowedValues = $rawAllowedValues
+ }
+
# Prepare the links to local headers
$paramHeader = '### Parameter: `{0}`' -f $parameter.name
$paramIdentifier = ('#{0}' -f $paramHeader.TrimStart('#').Trim().ToLower()) -replace '[:|`]' -replace ' ', '-'
# Add external single quotes to all default values of type string except for those using functions
$description = $parameter.metadata.description.Replace("`r`n", '').Replace("`n", '
')
- $allowedValues = ($rawAllowedValues -is [array]) ? ('[{0}]' -f (($rawAllowedValues | Sort-Object) -join ', ')) : (($rawAllowedValues -is [hashtable]) ? '{object}' : $rawAllowedValues)
# Further, replace all "empty string" default values with actual visible quotes
if ([regex]::Match($allowedValues, '^(\[\s*,.+)|(\[.+,\s*,)|(.+,\s*\])$').Captures.Count -gt 0) {
$allowedValues = $allowedValues -replace '\[\s*,', "[''," -replace ',\s*,', ", ''," -replace ',\s*\]', ", '']"
@@ -269,6 +294,36 @@ function Set-ParametersSection {
$description = $description.substring("$category. ".Length)
$newSectionContent += ('| [`{0}`]({1}) | {2} | {3} |' -f $parameter.name, $paramIdentifier, $type, $description)
+ if (-not [String]::IsNullOrEmpty($defaultValue)) {
+ if (($defaultValue -split '\n').count -eq 1) {
+ $formattedDefaultValue = '- Default: `{0}`' -f $defaultValue
+ } else {
+ $formattedDefaultValue = @(
+ '- Default:',
+ ' ```Bicep',
+ ($defaultValue -split '\n' | ForEach-Object { " $_" } | Out-String).TrimEnd(),
+ ' ```'
+ )
+ }
+ } else {
+ $formattedDefaultValue = $null
+ }
+
+ if (-not [String]::IsNullOrEmpty($allowedValues)) {
+ if (($allowedValues -split '\n').count -eq 1) {
+ $formattedAllowedValues = '- Default: `{0}`' -f $allowedValues
+ } else {
+ $formattedAllowedValues = @(
+ '- Allowed:',
+ ' ```Bicep',
+ ($allowedValues -split '\n' | Where-Object { -not [String]::IsNullOrEmpty($_) } | ForEach-Object { " $_" } | Out-String).TrimEnd(),
+ ' ```'
+ )
+ }
+ } else {
+ $formattedAllowedValues = $null
+ }
+
$parameterList += @{
$paramIdentifier = @(
$paramHeader,
@@ -276,8 +331,8 @@ function Set-ParametersSection {
$description,
('- Required: {0}' -f ($isRequired ? 'Yes' : 'No')),
('- Type: {0}' -f $type),
- ((-not [String]::IsNullOrEmpty($defaultValue)) ? ('- Default: `{0}`' -f $defaultValue) : $null),
- ((-not [String]::IsNullOrEmpty($allowedValues)) ? ('- Allowed: `{0}`' -f $allowedValues) : $null),
+ ((-not [String]::IsNullOrEmpty($formattedDefaultValue)) ? $formattedDefaultValue : $null),
+ ((-not [String]::IsNullOrEmpty($formattedAllowedValues)) ? $formattedAllowedValues : $null),
'',
(($parameterUsageContentMap.Keys -contains $parameter.name) ? $parameterUsageContentMap[$parameter.name] : $null)
) | Where-Object { $null -ne $_ }
@@ -391,6 +446,9 @@ function Set-DefinitionSection {
if ($parameterValue.ContainsKey('items') -and $parameterValue['items'].ContainsKey('properties')) {
$childProperties = $parameterValue['items']['properties']
$listSectionContent += Set-DefinitionSection -TemplateFileContent $TemplateFileContent -Properties $childProperties -ParentName $paramIdentifier -ParentIdentifierLink $paramIdentifierLink
+ } elseif ($parameterValue.type -eq 'object' -and $parameterValue['properties']) {
+ $childProperties = $parameterValue['properties']
+ $listSectionContent += Set-DefinitionSection -TemplateFileContent $TemplateFileContent -Properties $childProperties -ParentName $paramIdentifier -ParentIdentifierLink $paramIdentifierLink
}
}
@@ -1085,6 +1143,7 @@ function Set-UsageExamplesSection {
)
$brLink = Get-BRMRepositoryName -TemplateFilePath $TemplateFilePath
+ $targetVersion = Get-ModuleTargetVersion -ModuleFolderPath (Split-Path $TemplateFilePath -Parent)
# Process content
$SectionContent = [System.Collections.ArrayList]@(
@@ -1092,7 +1151,7 @@ function Set-UsageExamplesSection {
'',
'>**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.',
'',
- ('>**Note**: To reference the module, please use the following syntax `br/public:{0}:1.0.0`.' -f $brLink),
+ ('>**Note**: To reference the module, please use the following syntax `br/public:{0}:{1}`.' -f $brLink, $targetVersion),
''
)
@@ -1193,7 +1252,7 @@ function Set-UsageExamplesSection {
# [3/6] Format header, remove scope property & any empty line
$rawBicepExample = $rawBicepExampleString -split '\n'
- $rawBicepExample[0] = "module $moduleNameCamelCase 'br/public:$($brLink):1.0.0' = {"
+ $rawBicepExample[0] = "module $moduleNameCamelCase 'br/public:$($brLink):$($targetVersion)' = {"
$rawBicepExample = $rawBicepExample | Where-Object { $_ -notmatch 'scope: *' } | Where-Object { -not [String]::IsNullOrEmpty($_) }
# [4/6] Extract param block
$rawBicepExampleArray = $rawBicepExample -split '\n'
@@ -1561,6 +1620,7 @@ function Set-ModuleReadMe {
. (Join-Path $PSScriptRoot 'helper' 'Get-SpecsAlignedResourceName.ps1')
. (Join-Path $PSScriptRoot 'helper' 'ConvertTo-OrderedHashtable.ps1')
. (Join-Path (Split-Path $PSScriptRoot -Parent) 'publish' 'helper' 'Get-BRMRepositoryName.ps1')
+ . (Join-Path (Split-Path $PSScriptRoot -Parent) 'publish' 'helper' 'Get-ModuleTargetVersion.ps1')
# Check template & make full path
$TemplateFilePath = Resolve-Path -Path $TemplateFilePath -ErrorAction Stop
@@ -1710,7 +1770,7 @@ function Set-ModuleReadMe {
Write-Verbose "File [$ReadMeFilePath] updated" -Verbose
} else {
if ($PSCmdlet.ShouldProcess("File in path [$ReadMeFilePath]", 'Create')) {
- $null = New-Item -Path $ReadMeFilePath -Value $readMeFileContent -Force
+ $null = New-Item -Path $ReadMeFilePath -Value ($readMeFileContent | Out-String) -Force
}
Write-Verbose "File [$ReadMeFilePath] created" -Verbose
}