你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Publish-AzureVMDscConfiguration
将所需的状态配置脚本发布到 Azure Blob 存储。
注意
本文档中引用的 cmdlet 用于管理使用 Azure Service Manager (ASM) API 的旧式 Azure 资源。 创建新资源时,建议不要使用旧的 PowerShell 模块,因为计划将停用 ASM。 有关详细信息,请参阅 Azure Service Manager 停用。
Az PowerShell 模块是建议用于管理 PowerShell 的 Azure 资源管理器 (ARM) 资源的 PowerShell 模块。
语法
Publish-AzureVMDscConfiguration
[-ConfigurationPath] <String>
[-ContainerName <String>]
[-Force]
[-StorageContext <AzureStorageContext>]
[-StorageEndpointSuffix <String>]
[-SkipDependencyDetection]
[-ConfigurationDataPath <String>]
[-AdditionalPath <String[]>]
[-PassThru]
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Publish-AzureVMDscConfiguration
[-ConfigurationPath] <String>
[-Force]
[-ConfigurationArchivePath <String>]
[-SkipDependencyDetection]
[-ConfigurationDataPath <String>]
[-AdditionalPath <String[]>]
[-PassThru]
[-Profile <AzureSMProfile>]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Publish-AzureVMDscConfiguration cmdlet 将所需的状态配置脚本发布到 Azure Blob 存储,稍后可以使用 Set-AzureVMDscExtension cmdlet 将脚本应用到 Azure 虚拟机。
示例
示例 1:将状态配置脚本发布到 Blob 存储
PS C:\> Publish-AzureVMDscConfiguration .\MyConfiguration.ps1
此命令为给定脚本和任何依赖资源模块创建.zip包,并将其上传到 Azure 存储。
示例 2:将状态配置脚本发布到本地文件
PS C:\> Publish-AzureVMDscConfiguration .\MyConfiguration.ps1 -ConfigurationArchivePath .\MyConfiguration.ps1.zip
此命令为给定脚本和任何依赖资源模块创建.zip包,并将其存储在本地文件 .\MyConfiguration.ps1.zip中。
参数
-AdditionalPath
指定其他路径的数组。
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ConfigurationArchivePath
指定此 cmdlet 写入配置存档的本地.zip文件的路径。 如果使用此参数,则配置脚本不会上传到 Azure Blob 存储。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ConfigurationDataPath
指定配置数据路径。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-ConfigurationPath
指定包含一个或多个配置的文件的路径。 该文件可以是 Windows PowerShell 脚本(.ps1 文件)、模块(.psm1 文件)或存档(.zip文件),其中包含一组 Windows PowerShell 模块,每个模块都位于单独的目录中。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ContainerName
指定将配置上传到的 Azure 存储容器的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Force
强制运行命令而不要求用户确认。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InformationAction
指定此 cmdlet 如何响应信息事件。
此参数的可接受值为:
- 继续
- 忽略
- 询问
- SilentlyContinue
- 停止
- Suspend
类型: | ActionPreference |
别名: | infa |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InformationVariable
指定信息变量。
类型: | String |
别名: | iv |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PassThru
返回一个代表你所处理的项目的对象。 默认情况下,此 cmdlet 将不产生任何输出。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Profile
指定此 cmdlet 从中读取的 Azure 配置文件。 如果未指定配置文件,此 cmdlet 将从本地默认配置文件中读取。
类型: | AzureSMProfile |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SkipDependencyDetection
指示此 cmdlet 跳过依赖项检测。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-StorageContext
指定 Azure 存储上下文,该上下文提供用于将配置脚本上传到 ContainerName 参数指定的容器的安全设置。 此上下文提供对容器的写入访问权限。
类型: | AzureStorageContext |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-StorageEndpointSuffix
指定存储终结点的后缀,例如,core.contoso.net
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |