Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ESXiのオフラインバンドルから、ISO イメージファイルをエクスポート。
# Usage:
# PowerCLI> .\export_esxi-offline-bundle_to_iso.ps1 <Offline_Bundle.zip> <Export_Dir>
$offline_bundle_path = $args[0]
$export_dir = $args[1]
Add-EsxSoftwareDepot $offline_bundle_path | Out-Null
Get-EsxImageProfile | where {$_.Name -notmatch "s-standard|-no-tools"} | % {
$img_profile = $_
$img_profile_name = $img_profile.Name
$iso_file_name = Join-Path $export_dir ($img_profile_name + ".iso")
Write-Host "Export ISO File: $iso_file_name"
Export-EsxImageProfile $img_profile -ExportToIso -FilePath $iso_file_name
}
@gowatana
Copy link
Author

gowatana commented Feb 2, 2018

実行例。

PowerCLI> ls | select Name,Length

Name                                     Length
----                                     ------
ESXi650-201712001.zip                 478519869
export_esxi-offline-bundle_to_iso.ps1       502


PowerCLI> .\export_esxi-offline-bundle_to_iso.ps1 .\ESXi650-201712001.zip D:\work\
Export ISO File: D:\work\ESXi-6.5.0-20171204001-standard.iso

@gowatana
Copy link
Author

gowatana commented Feb 2, 2018

@gowatana
Copy link
Author

gowatana commented Oct 8, 2018

PowerCLI 10.x でも大丈夫なはず。

@gowatana
Copy link
Author

gowatana commented Jan 2, 2021

PowerCLI 12.x でも大丈夫。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment