將 CLIXML 檔案匯入 Windows PowerShell 並建立對應的物件。
語法
Import-Clixml [-Path] <string[]> [<CommonParameters>]
描述
Import-Clixml Cmdlet 會將包含了代表 Microsoft .NET Framework 物件之資料的 CLIXML 檔案匯入,並在 Windows PowerShell 中建立這些物件。
參數
-Path <string[]>
指定要轉換成 Windows PowerShell 物件之 XML 檔案的位置。
必要? |
true |
位置? |
1 |
預設值 |
|
接受管線輸入? |
true (ByValue, ByPropertyName) |
接受萬用字元? |
false |
<CommonParameters>
這個 Cmdlet 支援一般參數:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。如需詳細資訊,請參閱 about_Commonparameters.
輸入和輸出
輸入型別是可經由管道輸出至 Cmdlet 的物件型別。傳回型別則是 Cmdlet 所傳回的物件型別。
輸入 |
System.String 您可經由管道將包含路徑的字串輸出至 Import-Clixml。 |
輸出 |
PSObject Import-Clixml 會傳回已經從儲存的 XML 檔案中還原序列化的物件。 |
附註
若要為參數指定多重數值,請使用逗號來分隔數值。例如:"<參數名稱> <值1>, <值2>"。
範例 1
C:\PS>get-process | export-clixml pi.xml C:\PS> $processes = import-clixml pi.xml 描述 ----------- 這個命令會使用 Export-Clixml Cmdlet 來儲存 Get-Process 所傳回之處理序資訊的序列化副本。它接著使用 Import-Clixml 來擷取序列化檔案的內容,並重新建立儲存在 $processes 變數中的物件。