powershell 将vRA蓝图导出为PowervRA的内容包

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 将vRA蓝图导出为PowervRA的内容包相关的知识,希望对你有一定的参考价值。

#requires -version 5

<#

    - Export vRA Blueprint content package and extract the archive
    - Requires PowerShell 5

#>

# --- Set Filter
$Filter = "CentOS*"

# --- Get blueprints
$Blueprints = Get-vRABlueprint -Verbose | Where-Object {$_.Name -like $Filter}

# --- Create a content package for each blueprint in $Blueprints
$Blueprints | ForEach-Object {

    New-vRAContentPackage -BlueprintId $_.Id -Name "$($_.Name)" -Description "Content package for blueprint $($_.Name)" -Verbose | Out-Null

}

# --- Get content packages
$ContentPackages = Get-vRAContentPackage -Verbose | Where-Object {$_.Name -like $Filter}

# --- Export each content package to the current directory
$ContentPackages | ForEach-Object {

    $File = Export-vRAContentPackage -Id $_.Id -File "$($_.Name).zip" -Verbose

    # --- Unzip
    $Destination = "$($File.DirectoryName)\$($File.BaseName)"
    Expand-Archive -Path $File.FullName -DestinationPath $Destination -Verbose
    Remove-Item -Path $File.FullName -Force -Verbose

}

以上是关于powershell 将vRA蓝图导出为PowervRA的内容包的主要内容,如果未能解决你的问题,请参考以下文章

如何将ue4的蓝图类转换为c++类

powershell 将组成员身份导出为CSV

powershell PS SP将列表导出为CSV

powershell 将本地文件的属性导出为CSV文件。

powershell 将所有组中的所有术语集导出为CSV文件。

powershell 这将使用power shell获取特定SharePoint网站集下的所有子网站的列表。第二个文件获取我们的子站点