你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Export-AzAutomationDscConfiguration
将 DSC 配置从自动化导出到本地文件。
语法
Export-AzAutomationDscConfiguration
-Name <String>
[-Slot <String>]
[-OutputFolder <String>]
[-Force]
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Export-AzAutomationDscConfiguration cmdlet 将 APS Desired State Configuration (DSC) 配置从 Azure 自动化导出到本地文件。 导出的文件具有 .ps1 文件扩展名。
示例
示例 1:导出 DSC 配置的已发布版本
Export-AzAutomationDscConfiguration -ResourceGroupName "ResourceGroup01" -AutomationAccountName "AutomationAccount01" -Name "Configuration01" -Slot Published -OutputFolder "C:\Users\PattiFuller\Desktop"
此命令将自动化中 DSC 配置的已发布版本导出到指定文件夹(即桌面)。
参数
-AutomationAccountName
指定包含此 cmdlet 导出的 DSC 的自动化帐户的名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Force
指示此 cmdlet 将现有本地文件替换为具有相同名称的新文件。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
指定此 cmdlet 导出的 DSC 配置的名称。
类型: | String |
别名: | ConfigurationName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-OutputFolder
指定此 cmdlet 导出 DSC 配置的输出文件夹。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ResourceGroupName
指定此 cmdlet 为其导出 DSC 配置的资源组的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Slot
指定此 cmdlet 导出的 DSC 配置版本。 有效值为:
- 草案
- 已发布 默认值为“已发布”。
类型: | String |
接受的值: | Published, Draft |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |