共用方式為


Publish-AzureVMDscConfiguration

將所需的狀態設定文本發佈至 Azure Blob 記憶體。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (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>]

Description

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
  • 停止
  • 暫止
類型: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