en-US/PSRule.Rules.Azure-help.xml
<?xml version="1.0" encoding="utf-8"?> <helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Export-AzRuleData</command:name> <command:verb>Export</command:verb> <command:noun>AzRuleData</command:noun> <maml:description> <maml:para>Export resource configuration data from one or more Azure subscriptions.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Export resource configuration data from deployed resources in one or more Azure subscriptions.</maml:para> <maml:para>If no filters are specified then the current subscription context will be exported. i.e. `Get-AzContext`</maml:para> <maml:para>To export all subscriptions contexts use the `-All` switch. When the `-All` switch is used, all subscriptions contexts will be exported. i.e. `Get-AzContext -ListAvailable`</maml:para> <maml:para>Resource data will be exported to the current working directory by default as JSON files, one per subscription.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Export-AzRuleData</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>OutputPath</maml:name> <maml:description> <maml:para>The path to store generated JSON files containing resources.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>All</maml:name> <maml:description> <maml:para>By default, resources from the current subscription context are extracted. Use `-All` to extract resource data for all subscription contexts instead.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description> <maml:para>By default, FileInfo objects are returned to the pipeline for each JSON file created. When `-PassThru` is specified, JSON files are not created and Azure resource objects are returned to the pipeline instead.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceGroupName</maml:name> <maml:description> <maml:para>Optionally filter resources by Resource Group name.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tag</maml:name> <maml:description> <maml:para>Optionally filter resources based on tag.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Export-AzRuleData</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>OutputPath</maml:name> <maml:description> <maml:para>The path to store generated JSON files containing resources.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description> <maml:para>By default, FileInfo objects are returned to the pipeline for each JSON file created. When `-PassThru` is specified, JSON files are not created and Azure resource objects are returned to the pipeline instead.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceGroupName</maml:name> <maml:description> <maml:para>Optionally filter resources by Resource Group name.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Subscription</maml:name> <maml:description> <maml:para>Optionally filter resources by subscription, Id or Name.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tag</maml:name> <maml:description> <maml:para>Optionally filter resources based on tag.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tenant</maml:name> <maml:description> <maml:para>Optionally filter resources by a unique Tenant identifer.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>All</maml:name> <maml:description> <maml:para>By default, resources from the current subscription context are extracted. Use `-All` to extract resource data for all subscription contexts instead.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>OutputPath</maml:name> <maml:description> <maml:para>The path to store generated JSON files containing resources.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description> <maml:para>By default, FileInfo objects are returned to the pipeline for each JSON file created. When `-PassThru` is specified, JSON files are not created and Azure resource objects are returned to the pipeline instead.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ResourceGroupName</maml:name> <maml:description> <maml:para>Optionally filter resources by Resource Group name.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Subscription</maml:name> <maml:description> <maml:para>Optionally filter resources by subscription, Id or Name.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tag</maml:name> <maml:description> <maml:para>Optionally filter resources based on tag.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tenant</maml:name> <maml:description> <maml:para>Optionally filter resources by a unique Tenant identifer.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.IO.FileInfo</maml:name> </dev:type> <maml:description> <maml:para>Return `FileInfo` for each of the output files created, one per subscription. This is the default.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>PSObject</maml:name> </dev:type> <maml:description> <maml:para>Return an object for each Azure resource, and configuration exported. This is returned when the `-PassThru` switch is used.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>Export-AzRuleData Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 1/07/2019 10:03 AM 7304948 00000000-0000-0000-0000-000000000001.json</dev:code> <dev:remarks> <maml:para>Export resource configuration data from current subscription context.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>Export-AzRuleData -Subscription 'Contoso Production', 'Contoso Non-production' Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 1/07/2019 10:03 AM 7304948 00000000-0000-0000-0000-000000000001.json -a---- 1/07/2019 10:03 AM 7304948 00000000-0000-0000-0000-000000000002.json</dev:code> <dev:remarks> <maml:para>Export resource configuration data from subscriptions by name.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code>Export-AzRuleData -ResourceGroupName 'rg-app1-web', 'rg-app1-db' Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 1/07/2019 10:03 AM 7304948 00000000-0000-0000-0000-000000000001.json</dev:code> <dev:remarks> <maml:para>Export resource configuration data from two resource groups within the current subscription context.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/Microsoft/PSRule.Rules.Azure/blob/main/docs/commands/PSRule.Rules.Azure/en-US/Export-AzRuleData.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Export-AzRuleTemplateData</command:name> <command:verb>Export</command:verb> <command:noun>AzRuleTemplateData</command:noun> <maml:description> <maml:para>Export resource configuration data from Azure templates.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Export resource configuration data by merging Azure Resource Manager (ARM) template and parameter files. Template and parameters are merged by resolving template parameters, variables and functions.</maml:para> <maml:para>This function does not check template files for strict compliance with Azure schemas.</maml:para> <maml:para>By default this is an offline process, requiring no connectivity to Azure. Some functions that may be included in templates dynamically query Azure for current state. For these functions standard placeholder values are used by default. Functions that use placeholders include `reference`, `list*`.</maml:para> <maml:para>The `subscription()` function will return the following unless overridden:</maml:para> <maml:para>- subscriptionId: 'ffffffff-ffff-ffff-ffff-ffffffffffff'</maml:para> <maml:para>- tenantId: 'ffffffff-ffff-ffff-ffff-ffffffffffff'</maml:para> <maml:para>- displayName: 'PSRule Test Subscription'</maml:para> <maml:para>- state: 'NotDefined'</maml:para> <maml:para></maml:para> <maml:para>The `resourceGroup()` function will return the following unless overridden:</maml:para> <maml:para>- name: 'ps-rule-test-rg'</maml:para> <maml:para>- location: 'eastus'</maml:para> <maml:para>- tags: { }</maml:para> <maml:para>- properties:</maml:para> <maml:para> - provisioningState: 'Succeeded'</maml:para> <maml:para>To override, set the `AZURE_SUBSCRIPTION` and `AZURE_RESOURCE_GROUP` in configuration.</maml:para> <maml:para>Currently the following limitations apply:</maml:para> <maml:para>- Nested templates are expanded, external templates are not. - Deployment resources that link to an external template are returned as a resource. - The `pickZones` template function is not supported.</maml:para> <maml:para>- The `environment` template function always returns values for Azure public cloud.</maml:para> <maml:para>- References to Key Vault secrets are not expanded.</maml:para> <maml:para>A placeholder value is used instead. - Multi-line strings and user-defined functions are not supported.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Export-AzRuleTemplateData</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:description> <maml:para>The name of the deployment. If not specified `export-<xxxxxxxx>` will be used as the name of the deployment.</maml:para> <maml:para>This parameter is used by the `deployment()` function and is also used to name the output file.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>TemplateFile</maml:name> <maml:description> <maml:para>The absolute or relative file path to an Azure Resource Manager template file.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="TemplateParameterFile"> <maml:name>ParameterFile</maml:name> <maml:description> <maml:para>The absolute or relative file path to one or more Azure Resource Manager template parameter files.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputPath</maml:name> <maml:description> <maml:para>The path to store generated JSON files containing resources.</maml:para> <maml:para>If this parameter is not specified, output will be written to the current working path. The file name `resources-<name>.json` will be used when this parameter is not set or a directory is specified. Where `<name>` is the name of the deployment specified by `-Name`.</maml:para> <maml:para>This parameter has no affect when `-PassThru` is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description> <maml:para>By default, FileInfo objects are returned to the pipeline for each JSON file created. When `-PassThru` is specified, JSON files are not created and Azure resource objects are returned to the pipeline instead.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ResourceGroupName"> <maml:name>ResourceGroup</maml:name> <maml:description> <maml:para>A name or hashtable of the Resource Group where the deployment will occur. This Resource Group specified here will be used to resolve the `resourceGroup()` function.</maml:para> <maml:para>When the name of Resource Group is specified, the Resource Group will be looked up and used during export. This requires an authenticated connection to Azure with permissions to read the specified Resource Group.</maml:para> <maml:para>Alternately, a hashtable of a Resource Group object can be specified. This option does not require an authenticated Azure connection. The hashtable will override the defaults for any specified properties.</maml:para> <maml:para>For more details see about_PSRule_Azure_Configuration.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ResourceGroupReference</command:parameterValue> <dev:type> <maml:name>ResourceGroupReference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Subscription</maml:name> <maml:description> <maml:para>The name or hashtable of the Subscription where the deployment will occur. This subscription specified here will be used to resolve the `subscription()` function.</maml:para> <maml:para>When a subscription name is specified, the Subscription will be looked up and used during export. This requires an authenticated connection to Azure with permissions to read the specified Subscription.</maml:para> <maml:para>Alternately, a hashtable of a Subscription object can be specified. This option does not require an authenticated Azure connection. The hashtable will override the defaults for any specified properties.</maml:para> <maml:para>For more details see about_PSRule_Azure_Configuration.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">SubscriptionReference</command:parameterValue> <dev:type> <maml:name>SubscriptionReference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:description> <maml:para>The name of the deployment. If not specified `export-<xxxxxxxx>` will be used as the name of the deployment.</maml:para> <maml:para>This parameter is used by the `deployment()` function and is also used to name the output file.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>TemplateFile</maml:name> <maml:description> <maml:para>The absolute or relative file path to an Azure Resource Manager template file.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="TemplateParameterFile"> <maml:name>ParameterFile</maml:name> <maml:description> <maml:para>The absolute or relative file path to one or more Azure Resource Manager template parameter files.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputPath</maml:name> <maml:description> <maml:para>The path to store generated JSON files containing resources.</maml:para> <maml:para>If this parameter is not specified, output will be written to the current working path. The file name `resources-<name>.json` will be used when this parameter is not set or a directory is specified. Where `<name>` is the name of the deployment specified by `-Name`.</maml:para> <maml:para>This parameter has no affect when `-PassThru` is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:description> <maml:para>By default, FileInfo objects are returned to the pipeline for each JSON file created. When `-PassThru` is specified, JSON files are not created and Azure resource objects are returned to the pipeline instead.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ResourceGroupName"> <maml:name>ResourceGroup</maml:name> <maml:description> <maml:para>A name or hashtable of the Resource Group where the deployment will occur. This Resource Group specified here will be used to resolve the `resourceGroup()` function.</maml:para> <maml:para>When the name of Resource Group is specified, the Resource Group will be looked up and used during export. This requires an authenticated connection to Azure with permissions to read the specified Resource Group.</maml:para> <maml:para>Alternately, a hashtable of a Resource Group object can be specified. This option does not require an authenticated Azure connection. The hashtable will override the defaults for any specified properties.</maml:para> <maml:para>For more details see about_PSRule_Azure_Configuration.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ResourceGroupReference</command:parameterValue> <dev:type> <maml:name>ResourceGroupReference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Subscription</maml:name> <maml:description> <maml:para>The name or hashtable of the Subscription where the deployment will occur. This subscription specified here will be used to resolve the `subscription()` function.</maml:para> <maml:para>When a subscription name is specified, the Subscription will be looked up and used during export. This requires an authenticated connection to Azure with permissions to read the specified Subscription.</maml:para> <maml:para>Alternately, a hashtable of a Subscription object can be specified. This option does not require an authenticated Azure connection. The hashtable will override the defaults for any specified properties.</maml:para> <maml:para>For more details see about_PSRule_Azure_Configuration.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">SubscriptionReference</command:parameterValue> <dev:type> <maml:name>SubscriptionReference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.IO.FileInfo</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>Export-AzRuleTemplateData -TemplateFile .\template.json -ParameterFile .\parameters.json;</dev:code> <dev:remarks> <maml:para>Export resource configuration data based on merging a template and parameter file together.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>Get-AzRuleTemplateLink | Export-AzRuleTemplateData;</dev:code> <dev:remarks> <maml:para>Recursively scan the current working path and export linked templates.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 3 --------------------------</maml:title> <dev:code>$subscription = @{ subscriptionId = 'nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn' displayName = 'My Azure Subscription' tenantId = 'nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn' } Get-AzRuleTemplateLink | Export-AzRuleTemplateData -Subscription $subscription;</dev:code> <dev:remarks> <maml:para>Export linked templates from the current working path using a specific subscription.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 4 --------------------------</maml:title> <dev:code>$rg = @{ name = 'my-test-rg' location = 'australiaeast' tags = @{ env = 'prod' } } Get-AzRuleTemplateLink | Export-AzRuleTemplateData -ResourceGroup $rg;</dev:code> <dev:remarks> <maml:para>Export linked templates from the current working path using a specific resource group.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/Microsoft/PSRule.Rules.Azure/blob/main/docs/commands/PSRule.Rules.Azure/en-US/Export-AzRuleTemplateData.md</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-AzRuleTemplateLink</command:name> <command:verb>Get</command:verb> <command:noun>AzRuleTemplateLink</command:noun> <maml:description> <maml:para>Get a metadata link to a Azure template file.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Gets a link between an Azure Resource Manager (ARM) parameter file and its referenced template file. Parameter files reference a template file by defining metadata. Alternatively, template files are discovered by naming convention.</maml:para> <maml:para>By default, when parameter files without a matching template are discovered an error is raised.</maml:para> <maml:para>To reference a template, set the `metadata.template` property to a file path. Referencing templates outside of the path specified with `-Path` is not permitted.</maml:para> <maml:para>To discover template files by naming convention:</maml:para> <maml:para>- Both template and parameter files must be in the same sub-directory.</maml:para> <maml:para>- The parameter file must end with `.parameters.json`.</maml:para> <maml:para>- The parameter file must be named `<templateName>.parameters.json`.</maml:para> <maml:para>- The template file must be named `<templateName>.json`.</maml:para> <maml:para></maml:para> <maml:para>For more information see the about_PSRule_Azure_Metadata_Link topic.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-AzRuleTemplateLink</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="p"> <maml:name>Path</maml:name> <maml:description> <maml:para>Sets the path to search for parameter files in. By default, this is the current working path.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="1" aliases="f, TemplateParameterFile, FullName"> <maml:name>InputPath</maml:name> <maml:description> <maml:para>A path or filter to search for parameter files within the path specified by `-Path`. By default, files with `*.parameters.json` suffix will be used.</maml:para> <maml:para>When searching for parameter files all sub-directories will be scanned. To perform a shallow search, prefix input paths with `./`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>'*.parameters.json'</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipUnlinked</maml:name> <maml:description> <maml:para>Use this option to ignore parameter files that have no matching template. By default, when parameter files without a matching template are discovered an error is raised.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="1" aliases="f, TemplateParameterFile, FullName"> <maml:name>InputPath</maml:name> <maml:description> <maml:para>A path or filter to search for parameter files within the path specified by `-Path`. By default, files with `*.parameters.json` suffix will be used.</maml:para> <maml:para>When searching for parameter files all sub-directories will be scanned. To perform a shallow search, prefix input paths with `./`.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>'*.parameters.json'</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipUnlinked</maml:name> <maml:description> <maml:para>Use this option to ignore parameter files that have no matching template. By default, when parameter files without a matching template are discovered an error is raised.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="p"> <maml:name>Path</maml:name> <maml:description> <maml:para>Sets the path to search for parameter files in. By default, this is the current working path.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PWD</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PSRule.Rules.Azure.Data.Metadata.ITemplateLink</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>Get-AzRuleTemplateLink</dev:code> <dev:remarks> <maml:para>Get links from any `*.parameters.json` files within any folder in the current working path.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://github.com/Microsoft/PSRule.Rules.Azure/blob/main/docs/commands/PSRule.Rules.Azure/en-US/Get-AzRuleTemplateLink.md</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSRule_Azure_Metadata_Link</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |