From 3a4e907750835360023a5135e0d24e45d30debdb Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Thu, 7 Mar 2024 20:21:47 +0100 Subject: [PATCH 01/10] Add MARManifestGenerator PowerShell script --- .../MARManifestGenerator/Set-MARManifest.ps1 | 153 ++++++++ .../src/manifestHeader.yml | 330 ++++++++++++++++++ 2 files changed, 483 insertions(+) create mode 100644 utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 create mode 100644 utilities/tools/MARManifestGenerator/src/manifestHeader.yml diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 new file mode 100644 index 000000000..9d25ab006 --- /dev/null +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -0,0 +1,153 @@ +<# +.SYNOPSIS +Parses AVM module CSV file + +.DESCRIPTION +Depending on the parameter, the correct CSV file will be parsed and returned a an object + +.PARAMETER ModuleIndex +Type of CSV file, that should be parsed ('Bicep-Resource', 'Bicep-Pattern') + +.EXAMPLE +Next line will parse the AVM Bicep modules +Get-AvmCsvData -ModuleIndex 'Bicep-Resource' + +#> +Function Get-AvmCsvData { + [CmdletBinding()] + param ( + [Parameter(Mandatory=$false)] + [string[]] $ModuleIndexURLs = @('https://aka.ms/avm/index/bicep/res/csv', 'https://aka.ms/avm/index/bicep/ptn/csv') + ) + + $formattedBicepFullCsv = @() + + foreach ($url in $ModuleIndexURLs) { + try { + $unfilteredCSV = Invoke-WebRequest -Uri $url + } + catch { + Write-Error "Unable to retrieve CSV file - Check network connection." + } + + # Convert the CSV content to a PowerShell object + $formattedBicepFullCsv += ConvertFrom-CSV $unfilteredCSV.Content + } + + # Loop through each item in the filtered data + foreach ($item in $formattedBicepFullCsv) { + # Remove '@Azure/' from the ModuleOwnersGHTeam property + $item.ModuleOwnersGHTeam = $item.ModuleOwnersGHTeam -replace '@Azure/', '' + # Remove '@Azure/' from the ModuleContributorsGHTeam property + $item.ModuleContributorsGHTeam = $item.ModuleContributorsGHTeam -replace '@Azure/', '' + } + + # Return the modified data + return $formattedBicepFullCsv +} + +<# +.SYNOPSIS +Creates a block of YAML entries based on a AVM CSV file + +.DESCRIPTION +The function reads the AVM CSV file and converts all entries into a YAML file entries for the MCR bicep.yaml file. + +.PARAMETER ModuleIndex +Type of CSV file, that should be parsed ('Bicep-Resource', 'Bicep-Pattern') + +.PARAMETER IndentFirstLine +Number of spaces to indent the first line of the YAML entry. + +.PARAMETER IndentOtherLines +Number of spaces to indent the other lines of the YAML entry. + +.EXAMPLE +New-ModuleYamlBlock -ModuleIndex Bicep-Resource -IndentFirstLine 2 -IndentOtherLines 4 + +.NOTES +The entries are sorted by the module name. +#> +function New-ModuleYamlBlock { + [CmdletBinding(SupportsShouldProcess)] + param ( + [Parameter(Mandatory=$false)] + [int] $IndentFirstLine = 2, + + [Parameter(Mandatory=$false)] + [int] $IndentOtherLines = 4 + ) + + # Define the logo and support link + $logoURL = 'https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png' + $supportLink = 'https://github.com/Azure/bicep-registry-modules/issues' + + # Retrieve the CSV data and sort it by the module name + $csvData = Get-AvmCsvData | Sort-Object -Property ModuleName + + # Create an array to store YAML entries + $yamlEntries = @() + + # Iterate through each CSV entry and convert it to a YAML entry + foreach ($csvLine in $csvData) { + $yamlEntry = @' +{6}- name: public/bicep/{0} +{7}displayName: {1} +{7}description: {2} +{7}logoUrl: {3} +{7}supportLink: {4} +{7}documentationLink: {5}/README.md +'@ + $yamlEntries += $yamlEntry -f ($csvLine.ModuleName, $csvLine.ModuleDisplayName, $csvLine.Description, $logoURL, $supportLink, $csvLine.RepoURL, $(' ' * $IndentFirstLine), $(' ' * $IndentOtherLines)) + [Environment]::NewLine + } + + # Return the YAML entries + return $yamlEntries +} + +<# +.SYNOPSIS +Creates the Bicep module YAML file in MCR + +.DESCRIPTION +The function generates the MCR bicep.yaml file based on the AVM CSV files. It uses the New-ModuleYamlBlock function +to create the YAML entries for the Bicep-Resource and Bicep-Pattern modules, then it composes the bicep.yaml file +and saves it to the specified location. + +.PARAMETER OutputPath +The path where the bicep.yaml file should be saved. + +.EXAMPLE +Set-MARManifest -OutputPath bicep.yml + +.NOTES +The entries are sorted by the full module name. +#> +function Set-MARManifest { + [CmdletBinding(SupportsShouldProcess)] + param ( + [Parameter(Mandatory = $false)] + [string] $OutputPath = $(Join-Path $PSScriptRoot 'bicep.yml') + ) + + # Retrieve the converted YAML entries for the Bicep-Resource and Bicep-Pattern modules + $yamlEntriesRes = New-ModuleYamlBlock + + # Constructing the output file content + # Adding the header file to the output file content + $headerFilePath = Join-Path $PSScriptRoot 'src' 'manifestHeader.yml' + if (-not (Test-Path $headerFilePath)) { + Write-Error "The header file [$headerFilePath] does not exist." + } + + # Adding the header file content to the output file content + $outputFileContent = Get-Content -Path $headerFilePath + + # Adding the Bicep-Resource YAML entries to the output file content + $outputFileContent += $yamlEntriesRes + + # Save the output file + $outputFileContent | Out-File -FilePath $OutputPath -Force +} + +Set-MARManifest \ No newline at end of file diff --git a/utilities/tools/MARManifestGenerator/src/manifestHeader.yml b/utilities/tools/MARManifestGenerator/src/manifestHeader.yml new file mode 100644 index 000000000..5ba879358 --- /dev/null +++ b/utilities/tools/MARManifestGenerator/src/manifestHeader.yml @@ -0,0 +1,330 @@ +version: 2.0 +subscriptionId: 22ec7257-9128-45a4-9751-69ef4f22a75b +resourceGroup: bicep-public-registry-rg +registry: biceppublic +onboardingNotification: brmmcronboarding +dependencyNotification: brmmcrdependency + +ownership: + securityGroups: + - groupName: redmond\bicepmcr + permissions: + - read + - write + +repos: + - name: public/bicep/samples/hello-world + displayName: Hello World + description: A "Hello World" sample Bicep registry module + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/samples/hello-world/README.md + + - name: public/bicep/samples/array-loop + displayName: Array loop + description: A sample Bicep registry module demonstrating array iterations + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/samples/array-loop/README.md + + - name: public/bicep/ai/bing-resource + displayName: Bing Resource + description: Deploys Azure Bing resource + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/ai/bing-resource/README.md + + - name: public/bicep/ai/cognitiveservices + displayName: Cognitive Services + description: Deploys CognitiveServices and optionally available integrations + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/ai/cognitiveservices/README.md + + - name: public/bicep/apim/product + displayName: API Management product + description: An API Management product for grouping and controlling access to APIs + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/apim/product/README.md + + - name: public/bicep/app/app-configuration + displayName: Azure App Configuration + description: Bicep module for simplified deployment Azure App Configuration resources + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/app/app-configuration/README.md + + - name: public/bicep/app/dapr-containerapp + displayName: Dapr container app + description: A dapr optimised container app + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/app/dapr-containerapp/README.md + + - name: public/bicep/app/dapr-containerapps-environment + displayName: Container Apps Environment for DAPR + description: Provides an optimised Container App Environment for DAPR applications + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/app/dapr-containerapps-environment/README.md + + - name: public/bicep/authorization/resource-scope-role-assignment + displayName: Resource scoped role assignment + description: Create an Azure Authorization Role Assignment at the scope of a resource + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/authorization/resource-scope-role-assignment/README.md + + - name: public/bicep/azure-gaming/game-dev-vm + displayName: Azure Game Developer VM + description: Bicep Module to simplify deployment of the Azure Game Developer VM + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/azure-gaming/game-dev-vm/README.md + + - name: public/bicep/azure-gaming/game-dev-vmss + displayName: Azure Game Developer VMSS + description: Bicep Module to simplify deployment of the Azure Game Developer VMSS + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/azure-gaming/game-dev-vmss/README.md + + - name: public/bicep/azure-gaming/unreal-cloud-ddc + displayName: Unreal Cloud DDC + description: Bicep module for simplified deployment of Unreal Cloud DDC + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/azure-gaming/unreal-cloud-ddc/README.md + + - name: public/bicep/compute/availability-set + displayName: Availability Set + description: Deploys Microsoft.Compute Availability Sets and optionally available children or extensions + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/compute/availability-set/README.md + + - name: public/bicep/compute/container-registry + displayName: Bicep Container Registry Module + description: Bicep module to deploy Container Registry and optionally available integrations + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/compute/container-registry/README.md + + - name: public/bicep/compute/custom-image-vmss + displayName: Azure VMSS with Custom Image + description: Create an Azure VMSS Cluster with a Custom Image to simplify creation of Marketplace Applications + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/compute/custom-image-vmss/README.md + + - name: public/bicep/compute/event-hub + displayName: Azure Event-Hub + description: Deploys Microsoft.data event clusters, event namespace, and event hub + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/compute/event-hub/README.md + + - name: public/bicep/compute/function-app + displayName: Azure Function App + description: Bicep module to create Azure Function App + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/compute/function-app/README.md + + - name: public/bicep/cost/resourcegroup-scheduled-action + displayName: Cost Management scheduled action for resource groups + description: Creates a scheduled action to notify recipients about the latest costs + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/cost/resourcegroup-scheduled-action/README.md + + - name: public/bicep/cost/subscription-scheduled-action + displayName: Cost Management scheduled action for subscriptions + description: Creates a scheduled action to notify recipients about the latest costs + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/cost/subscription-scheduled-action/README.md + + - name: public/bicep/deployment-scripts/aks-run-command + displayName: AKS Run Command Script + description: A Deployment Script that allows you to run a command on a Kubernetes cluster. + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/deployment-scripts/aks-run-command/README.md + + - name: public/bicep/deployment-scripts/aks-run-helm + displayName: AKS Run Helm Script + description: An Azure CLI Deployment Script that allows you to run a Helm command at a Kubernetes cluster. + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/deployment-scripts/aks-run-helm/README.md + + - name: public/bicep/deployment-scripts/build-acr + displayName: ACR Image Build + description: Builds a container image inside ACR from source code. + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/deployment-scripts/build-acr/README.md + + - name: public/bicep/deployment-scripts/create-kv-certificate + displayName: AKV Certs in AGW + description: A Deployment Script that creates Key Vault self-signed certificates. + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/deployment-scripts/create-kv-certificate/README.md + + - name: public/bicep/deployment-scripts/create-kv-sshkeypair + displayName: SSH Key Pair Creation + description: Creates SSH Key Pair Stores them in KeyVault as Secrets + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/deployment-scripts/create-kv-sshkeypair/README.md + + - name: public/bicep/deployment-scripts/import-acr + displayName: ACR Image Import + description: A Deployment Script that imports public container images to an Azure Container Registry + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/deployment-scripts/import-acr/README.md + + - name: public/bicep/deployment-scripts/wait + displayName: Wait + description: A Deployment Script that introduces a delay to the deployment process + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/deployment-scripts/wait/README.md + + - name: public/bicep/lz/sub-vending + displayName: Bicep Landing Zone (Subscription) Vending Module + description: Bicep module to accelerate deployment of landing zones (aka Subscriptions) within an Azure AD Tenant + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/lz/sub-vending/README.md + + - name: public/bicep/identity/user-assigned-identity + displayName: Azure Managed Identity + description: Bicep module to deploy Azure managed identities + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/identity/user-assigned-identity/README.md + + - name: public/bicep/network/virtual-network + displayName: Virtual Networks + description: Deploys Microsoft.Network Virtual Networks and optionally available children or extensions + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.pngdeploy Azure managed identities. + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/network/virtual-network/README.md + + - name: public/bicep/network/traffic-manager + displayName: Traffic Manager + description: Bicep module for creating a Azure Traffic Manager Profile with endpoints and monitor configurations + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/network/traffic-manager/README.md + + - name: public/bicep/network/nat-gateway + displayName: NAT Gateway + description: A Bicep module for simplified deployment for NAT gateways and available configuration options + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/network/nat-gateway/README.md + + - name: public/bicep/network/dns-zone + displayName: DNS Zone + description: Azure DNS is a hosting service for DNS domains that provides name resolution + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/network/dns-zone/README.md + + - name: public/bicep/network/public-ip-address + displayName: Public IP Address + description: Bicep Module for creating Public IP Address + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/network/public-ip-address/README.md + + - name: public/bicep/network/public-ip-prefix + displayName: Public IP Prefix + description: Bicep Module for creating Public IP Prefix + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/network/public-ip-prefix/README.md + + - name: public/bicep/network/private-dns-zone + displayName: Private DNS Zone + description: A bicep module for simplified deployment for Private DNS Zones + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/network/private-dns-zone/README.md + + - name: public/bicep/observability/grafana + displayName: Azure Managed Grafana + description: Bicep Module for creating Azure Managed Grafana + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/observability/grafana/README.md + + - name: public/bicep/search/search-service + displayName: Azure Search Service + description: Bicep module for simplified deployment of Azure Cognitive Search + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/search/search-service/README.md + + - name: public/bicep/security/keyvault + displayName: Key Vault + description: Bicep module for simplified deployment of KeyVault + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/security/keyvault/README.md + + - name: public/bicep/storage/cosmos-db + displayName: Cosmos DB + description: Bicep module for simplified deployment of Cosmos DB + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/storage/cosmos-db/README.md + + - name: public/bicep/storage/data-explorer + displayName: Azure Data Explorer + description: Bicep module to create a Kusto Cluster with the specified number of nodes and version + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/storage/data-explorer/README.md + + - name: public/bicep/storage/storage-account + displayName: Storage Account Vault + description: Bicep module for simplified deployment of Storage Accounts + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/storage/storage-account/README.md + + - name: public/bicep/storage/log-analytics-workspace + displayName: Log Analytics Workspace + description: Deploys Log Analytics workspace and optionally available integrations + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/storage/log-analytics-workspace/README.md + + - name: public/bicep/storage/postgresql-single-server + displayName: PostgreSQL Single Server + description: Deploys Postgresql Single Server and optionally available integrations. + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/storage/postgresql-single-server/README.md + + - name: public/bicep/storage/redis-cache + displayName: Azure Cache for Redis + description: deploys Azure Cache for Redis(Microsoft.Cache/redis) and optionally available integrations + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/storage/redis-cache/README.md + + - name: public/bicep/storage/mysql-single-server + displayName: MySQL Single Server + description: Deploys MySQL Single Server and optionally available integrations. + logoUrl: https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png + supportLink: https://github.com/Azure/bicep-registry-modules/issues + documentationLink: https://github.com/Azure/bicep-registry-modules/blob/main/modules/storage/mysql-single-server/README.md + From 1d4a91c48e275447e12d2366d9db170a0088d2fb Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Thu, 7 Mar 2024 20:59:37 +0100 Subject: [PATCH 02/10] Updated parameters synopsis --- .../MARManifestGenerator/Set-MARManifest.ps1 | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index 9d25ab006..0793ad734 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -1,16 +1,15 @@ <# .SYNOPSIS -Parses AVM module CSV file +Parses AVM module CSV files .DESCRIPTION -Depending on the parameter, the correct CSV file will be parsed and returned a an object +The CSV files will be parsed and returned a an object -.PARAMETER ModuleIndex -Type of CSV file, that should be parsed ('Bicep-Resource', 'Bicep-Pattern') +.PARAMETER ModuleIndexURLs +Array the URLs, where module CSV files for Resource and Pattern modules are stored .EXAMPLE -Next line will parse the AVM Bicep modules -Get-AvmCsvData -ModuleIndex 'Bicep-Resource' +Get-AvmCsvData -ModuleIndexURLs 'https://example.com/url3', 'https://example.com/url4' #> Function Get-AvmCsvData { @@ -53,8 +52,11 @@ Creates a block of YAML entries based on a AVM CSV file .DESCRIPTION The function reads the AVM CSV file and converts all entries into a YAML file entries for the MCR bicep.yaml file. -.PARAMETER ModuleIndex -Type of CSV file, that should be parsed ('Bicep-Resource', 'Bicep-Pattern') +.PARAMETER logoURL +URL to the logo image for all modules. + +.PARAMETER supportLink +URL to the support page for all modules. .PARAMETER IndentFirstLine Number of spaces to indent the first line of the YAML entry. @@ -63,14 +65,20 @@ Number of spaces to indent the first line of the YAML entry. Number of spaces to indent the other lines of the YAML entry. .EXAMPLE -New-ModuleYamlBlock -ModuleIndex Bicep-Resource -IndentFirstLine 2 -IndentOtherLines 4 +Get-ModuleYamlBlock -ModuleIndex Bicep-Resource -IndentFirstLine 2 -IndentOtherLines 4 .NOTES The entries are sorted by the module name. #> -function New-ModuleYamlBlock { +function Get-ModuleYamlBlock { [CmdletBinding(SupportsShouldProcess)] param ( + [Parameter(Mandatory=$false)] + [string] $logoURL = 'https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png', + + [Parameter(Mandatory=$false)] + [string] $supportLink = 'https://github.com/Azure/bicep-registry-modules/issues', + [Parameter(Mandatory=$false)] [int] $IndentFirstLine = 2, @@ -78,10 +86,6 @@ function New-ModuleYamlBlock { [int] $IndentOtherLines = 4 ) - # Define the logo and support link - $logoURL = 'https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png' - $supportLink = 'https://github.com/Azure/bicep-registry-modules/issues' - # Retrieve the CSV data and sort it by the module name $csvData = Get-AvmCsvData | Sort-Object -Property ModuleName @@ -110,7 +114,7 @@ function New-ModuleYamlBlock { Creates the Bicep module YAML file in MCR .DESCRIPTION -The function generates the MCR bicep.yaml file based on the AVM CSV files. It uses the New-ModuleYamlBlock function +The function generates the MCR bicep.yaml file based on the AVM CSV files. It uses the Get-ModuleYamlBlock function to create the YAML entries for the Bicep-Resource and Bicep-Pattern modules, then it composes the bicep.yaml file and saves it to the specified location. @@ -131,7 +135,7 @@ function Set-MARManifest { ) # Retrieve the converted YAML entries for the Bicep-Resource and Bicep-Pattern modules - $yamlEntriesRes = New-ModuleYamlBlock + $yamlEntriesRes = Get-ModuleYamlBlock # Constructing the output file content # Adding the header file to the output file content @@ -149,5 +153,3 @@ function Set-MARManifest { # Save the output file $outputFileContent | Out-File -FilePath $OutputPath -Force } - -Set-MARManifest \ No newline at end of file From 13c2f1239985328d3405fe3a21252797e8b7d26d Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Thu, 7 Mar 2024 21:02:53 +0100 Subject: [PATCH 03/10] Add example call of Set-MARManifest function --- utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index 0793ad734..01ff94af2 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -153,3 +153,6 @@ function Set-MARManifest { # Save the output file $outputFileContent | Out-File -FilePath $OutputPath -Force } + +# # Launch the function +# Set-MARManifest -OutputPath .\bicep.yml \ No newline at end of file From a604e3076a8287670baa5afdde6e64c43f86d843 Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Thu, 7 Mar 2024 21:23:49 +0100 Subject: [PATCH 04/10] Addressed linter errors --- utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index 01ff94af2..cce4db499 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -50,7 +50,7 @@ Function Get-AvmCsvData { Creates a block of YAML entries based on a AVM CSV file .DESCRIPTION -The function reads the AVM CSV file and converts all entries into a YAML file entries for the MCR bicep.yaml file. +The function reads the AVM CSV file and converts all entries into a YAML file entries for the MCR bicep.yaml file. .PARAMETER logoURL URL to the logo image for all modules. @@ -71,7 +71,7 @@ Get-ModuleYamlBlock -ModuleIndex Bicep-Resource -IndentFirstLine 2 -IndentOtherL The entries are sorted by the module name. #> function Get-ModuleYamlBlock { - [CmdletBinding(SupportsShouldProcess)] + [CmdletBinding()] param ( [Parameter(Mandatory=$false)] [string] $logoURL = 'https://raw.githubusercontent.com/Azure/bicep/main/src/vscode-bicep/icons/bicep-logo-256.png', @@ -114,7 +114,7 @@ function Get-ModuleYamlBlock { Creates the Bicep module YAML file in MCR .DESCRIPTION -The function generates the MCR bicep.yaml file based on the AVM CSV files. It uses the Get-ModuleYamlBlock function +The function generates the MCR bicep.yaml file based on the AVM CSV files. It uses the Get-ModuleYamlBlock function to create the YAML entries for the Bicep-Resource and Bicep-Pattern modules, then it composes the bicep.yaml file and saves it to the specified location. @@ -135,7 +135,7 @@ function Set-MARManifest { ) # Retrieve the converted YAML entries for the Bicep-Resource and Bicep-Pattern modules - $yamlEntriesRes = Get-ModuleYamlBlock + $yamlEntriesRes = Get-ModuleYamlBlock # Constructing the output file content # Adding the header file to the output file content From 9836de894f46d0da638cbd3c5731fe69b913f230 Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Thu, 7 Mar 2024 21:28:01 +0100 Subject: [PATCH 05/10] Update Set-MARManifest.ps1 script --- utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index cce4db499..208dfb7fd 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -155,4 +155,4 @@ function Set-MARManifest { } # # Launch the function -# Set-MARManifest -OutputPath .\bicep.yml \ No newline at end of file +# Set-MARManifest -OutputPath .\bicep.yml From d40b52ea80f520f5f61f0430219e8a0db50a1579 Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Thu, 7 Mar 2024 21:38:24 +0100 Subject: [PATCH 06/10] Refactor Set-MARManifest.ps1 to use Join-Path cmdlet for header file path --- utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 | 4 ++-- .../tools/MARManifestGenerator/{src => }/manifestHeader.yml | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename utilities/tools/MARManifestGenerator/{src => }/manifestHeader.yml (100%) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index 208dfb7fd..0bd58d6fc 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -139,7 +139,7 @@ function Set-MARManifest { # Constructing the output file content # Adding the header file to the output file content - $headerFilePath = Join-Path $PSScriptRoot 'src' 'manifestHeader.yml' + $headerFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'manifestHeader.yml' if (-not (Test-Path $headerFilePath)) { Write-Error "The header file [$headerFilePath] does not exist." } @@ -155,4 +155,4 @@ function Set-MARManifest { } # # Launch the function -# Set-MARManifest -OutputPath .\bicep.yml +# Set-MARManifest diff --git a/utilities/tools/MARManifestGenerator/src/manifestHeader.yml b/utilities/tools/MARManifestGenerator/manifestHeader.yml similarity index 100% rename from utilities/tools/MARManifestGenerator/src/manifestHeader.yml rename to utilities/tools/MARManifestGenerator/manifestHeader.yml From 2afaaf7f5343b0cd0e171c80d69af0b317fe29f0 Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Thu, 7 Mar 2024 22:48:13 +0100 Subject: [PATCH 07/10] Removed empty last line --- .../tools/MARManifestGenerator/Set-MARManifest.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index 0bd58d6fc..e0e28f9cd 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -102,7 +102,10 @@ function Get-ModuleYamlBlock { {7}supportLink: {4} {7}documentationLink: {5}/README.md '@ - $yamlEntries += $yamlEntry -f ($csvLine.ModuleName, $csvLine.ModuleDisplayName, $csvLine.Description, $logoURL, $supportLink, $csvLine.RepoURL, $(' ' * $IndentFirstLine), $(' ' * $IndentOtherLines)) + [Environment]::NewLine + $yamlEntries += $yamlEntry -f ($csvLine.ModuleName, $csvLine.ModuleDisplayName, $csvLine.Description, $logoURL, $supportLink, $csvLine.RepoURL, $(' ' * $IndentFirstLine), $(' ' * $IndentOtherLines)) + if ($csvLine -ne $csvData[-1]) { # Add a newline between entries, except for the last one + $yamlEntries += [Environment]::NewLine + } } # Return the YAML entries @@ -135,7 +138,7 @@ function Set-MARManifest { ) # Retrieve the converted YAML entries for the Bicep-Resource and Bicep-Pattern modules - $yamlEntriesRes = Get-ModuleYamlBlock + $yamlEntries = Get-ModuleYamlBlock # Constructing the output file content # Adding the header file to the output file content @@ -148,11 +151,11 @@ function Set-MARManifest { $outputFileContent = Get-Content -Path $headerFilePath # Adding the Bicep-Resource YAML entries to the output file content - $outputFileContent += $yamlEntriesRes + $outputFileContent += $yamlEntries # Save the output file $outputFileContent | Out-File -FilePath $OutputPath -Force } # # Launch the function -# Set-MARManifest +Set-MARManifest \ No newline at end of file From d46e923ddf2e73513b8a3083b60532829d1d7083 Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Wed, 20 Mar 2024 00:51:19 +0100 Subject: [PATCH 08/10] Refactor YAML entry formatting in Set-MARManifest.ps1 --- utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index e0e28f9cd..184e6232d 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -102,9 +102,11 @@ function Get-ModuleYamlBlock { {7}supportLink: {4} {7}documentationLink: {5}/README.md '@ - $yamlEntries += $yamlEntry -f ($csvLine.ModuleName, $csvLine.ModuleDisplayName, $csvLine.Description, $logoURL, $supportLink, $csvLine.RepoURL, $(' ' * $IndentFirstLine), $(' ' * $IndentOtherLines)) if ($csvLine -ne $csvData[-1]) { # Add a newline between entries, except for the last one - $yamlEntries += [Environment]::NewLine + $yamlEntries += $yamlEntry -f ($csvLine.ModuleName, $csvLine.ModuleDisplayName, $csvLine.Description, $logoURL, $supportLink, $csvLine.RepoURL, $(' ' * $IndentFirstLine), $(' ' * $IndentOtherLines)) + [Environment]::NewLine + } + else { + $yamlEntries += $yamlEntry -f ($csvLine.ModuleName, $csvLine.ModuleDisplayName, $csvLine.Description, $logoURL, $supportLink, $csvLine.RepoURL, $(' ' * $IndentFirstLine), $(' ' * $IndentOtherLines)) } } From fe553a05457b1287525f6c84182a82b3888d02e5 Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Sun, 7 Apr 2024 00:59:56 +0200 Subject: [PATCH 09/10] Updated order of the functions (moved main function to the top) --- .../MARManifestGenerator/Set-MARManifest.ps1 | 95 +++++++++---------- 1 file changed, 46 insertions(+), 49 deletions(-) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index 184e6232d..ed86e18d5 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -1,3 +1,48 @@ +<# +.SYNOPSIS +Creates the Bicep module YAML file in MCR + +.DESCRIPTION +The function generates the MCR bicep.yaml file based on the AVM CSV files. It uses the Get-ModuleYamlBlock function +to create the YAML entries for the Bicep-Resource and Bicep-Pattern modules, then it composes the bicep.yaml file +and saves it to the specified location. + +.PARAMETER OutputPath +The path where the bicep.yaml file should be saved. + +.EXAMPLE +Set-MARManifest -OutputPath bicep.yml + +.NOTES +The entries are sorted by the full module name. +#> +Function Set-MARManifest { + [CmdletBinding(SupportsShouldProcess)] + param ( + [Parameter(Mandatory = $false)] + [string] $OutputPath = $(Join-Path $PSScriptRoot 'bicep.yml') + ) + + # Retrieve the converted YAML entries for the Bicep-Resource and Bicep-Pattern modules + $yamlEntries = Get-ModuleYamlBlock + + # Constructing the output file content + # Adding the header file to the output file content + $headerFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'manifestHeader.yml' + if (-not (Test-Path $headerFilePath)) { + Write-Error "The header file [$headerFilePath] does not exist." + } + + # Adding the header file content to the output file content + $outputFileContent = Get-Content -Path $headerFilePath + + # Adding the Bicep-Resource YAML entries to the output file content + $outputFileContent += $yamlEntries + + # Save the output file + $outputFileContent | Out-File -FilePath $OutputPath -Force +} + <# .SYNOPSIS Parses AVM module CSV files @@ -70,7 +115,7 @@ Get-ModuleYamlBlock -ModuleIndex Bicep-Resource -IndentFirstLine 2 -IndentOtherL .NOTES The entries are sorted by the module name. #> -function Get-ModuleYamlBlock { +Function Get-ModuleYamlBlock { [CmdletBinding()] param ( [Parameter(Mandatory=$false)] @@ -113,51 +158,3 @@ function Get-ModuleYamlBlock { # Return the YAML entries return $yamlEntries } - -<# -.SYNOPSIS -Creates the Bicep module YAML file in MCR - -.DESCRIPTION -The function generates the MCR bicep.yaml file based on the AVM CSV files. It uses the Get-ModuleYamlBlock function -to create the YAML entries for the Bicep-Resource and Bicep-Pattern modules, then it composes the bicep.yaml file -and saves it to the specified location. - -.PARAMETER OutputPath -The path where the bicep.yaml file should be saved. - -.EXAMPLE -Set-MARManifest -OutputPath bicep.yml - -.NOTES -The entries are sorted by the full module name. -#> -function Set-MARManifest { - [CmdletBinding(SupportsShouldProcess)] - param ( - [Parameter(Mandatory = $false)] - [string] $OutputPath = $(Join-Path $PSScriptRoot 'bicep.yml') - ) - - # Retrieve the converted YAML entries for the Bicep-Resource and Bicep-Pattern modules - $yamlEntries = Get-ModuleYamlBlock - - # Constructing the output file content - # Adding the header file to the output file content - $headerFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'manifestHeader.yml' - if (-not (Test-Path $headerFilePath)) { - Write-Error "The header file [$headerFilePath] does not exist." - } - - # Adding the header file content to the output file content - $outputFileContent = Get-Content -Path $headerFilePath - - # Adding the Bicep-Resource YAML entries to the output file content - $outputFileContent += $yamlEntries - - # Save the output file - $outputFileContent | Out-File -FilePath $OutputPath -Force -} - -# # Launch the function -Set-MARManifest \ No newline at end of file From b01798ab313fe911a1bdd99db6dff1864c33bb29 Mon Sep 17 00:00:00 2001 From: Kris Baranek Date: Sun, 7 Apr 2024 01:04:04 +0200 Subject: [PATCH 10/10] Renamed parameter OutputPath to more accurate OutputFile --- utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 index ed86e18d5..137504d37 100644 --- a/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 +++ b/utilities/tools/MARManifestGenerator/Set-MARManifest.ps1 @@ -7,11 +7,11 @@ The function generates the MCR bicep.yaml file based on the AVM CSV files. It us to create the YAML entries for the Bicep-Resource and Bicep-Pattern modules, then it composes the bicep.yaml file and saves it to the specified location. -.PARAMETER OutputPath +.PARAMETER OutputFile The path where the bicep.yaml file should be saved. .EXAMPLE -Set-MARManifest -OutputPath bicep.yml +Set-MARManifest -OutputFile bicep.yml .NOTES The entries are sorted by the full module name. @@ -20,7 +20,7 @@ Function Set-MARManifest { [CmdletBinding(SupportsShouldProcess)] param ( [Parameter(Mandatory = $false)] - [string] $OutputPath = $(Join-Path $PSScriptRoot 'bicep.yml') + [string] $OutputFile = $(Join-Path $PSScriptRoot 'bicep.yml') ) # Retrieve the converted YAML entries for the Bicep-Resource and Bicep-Pattern modules @@ -40,7 +40,7 @@ Function Set-MARManifest { $outputFileContent += $yamlEntries # Save the output file - $outputFileContent | Out-File -FilePath $OutputPath -Force + $outputFileContent | Out-File -FilePath $OutputFile -Force } <#