Import-AzureVM
從檔案匯入 Azure 虛擬機器狀態。
注意
本檔中參考的 Cmdlet 用於管理使用服務管理 API 的舊版 Azure 資源。 如需管理 Azure Resource Manager 資源的 Cmdlet,請參閱 Az PowerShell 模組 。
Syntax
Import-AzureVM
[-Path] <String>
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Description
Import-AzureVM Cmdlet 會從 XML 檔案匯入先前儲存的虛擬機器狀態。 當您想要從匯入的資料建立虛擬機器時,此 Cmdlet 會很有用。
執行 Export-AzureVM ,後面接著 Remove-AzureVM ,然後 Import-AzureVM 重新建立虛擬機器,可能會導致產生的虛擬機器具有不同于原始 IP 位址。
範例
範例 1:匯入虛擬機器狀態
PS C:\> Import-AzureVM -Path "C:\VMstate.xml" | New-AzureVM -ServiceName "ContosoService02"
此命令會從 VMstate.xml 檔案匯入虛擬機器的狀態,然後在指定的雲端服務中建立虛擬機器。
參數
-InformationAction
指定此 Cmdlet 如何回應資訊事件。
此參數可接受的值為:
- 繼續
- 忽略
- 詢問
- SilentlyContinue
- 停止
- 暫止
Type: | ActionPreference |
Aliases: | infa |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InformationVariable
指定資訊變數。
Type: | String |
Aliases: | iv |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Path
指定具有先前儲存之虛擬機器狀態的檔案路徑。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |