-
-
Save gowatana/a0601084181abb380fbb847bca5d8f29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# created by: gowatana | |
# usage: | |
# PS> Connect-VIServer | |
# PS> Get-VM -Name "vm01" | |
# PS> ./advent-2022-day01.ps1 | |
$vm = Get-VM -Name "vm01" | |
$tree_unicode = "1F384" | |
$tree_icon = [Char]::ConvertFromUtf32([Convert]::toInt32($tree_unicode, 16)) | |
$box_unicode = "1F381" | |
$box_icon = [Char]::ConvertFromUtf32([Convert]::toInt32($box_unicode, 16)) | |
1..9 | %{$vm | New-Snapshot -Name ("snap-" + $_.toString("00") + $tree_icon)} | |
$vm | Set-VM -Snapshot "snap-06*" -Confirm:$false | |
10..18 | %{$vm | New-Snapshot -Name ("snap-" + $_.toString("00") + $tree_icon)} | |
$vm | Set-VM -Snapshot "snap-15*" -Confirm:$false | |
19..27 | %{$vm | New-Snapshot -Name ("snap-" + $_.toString("00") + $tree_icon)} | |
28..31 | %{ | |
$vm | Set-VM -Snapshot "snap-01*" -Confirm:$false | |
$vm | New-Snapshot -Name ("snap-" + $_.toString("00")) | |
} | |
32 | %{$vm | New-Snapshot -Name ("snap-" + $_.toString("00") + $box_icon)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下記の投稿むけ。
PowerCLI で仮想マシンのスナップショットを作成してみる。(クリスマス編)
https://vm.gowatana.jp/entry/2022/12/01/012031