一、 列出Hyper-V PowerShell命令行模块
|
1
|
get-command
–module hyper-v |
out-gridview
|
|
1
|
get-vm
| where {
$_
.State –eq ‘Running’}
|
|
1
|
get-vm
| where {
$_
.State –eq ‘Off’}
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
$VMName
=
"Client01"
$VM
= @{
Name =
$VMName
MemoryStartupBytes = 2147483648
Generation = 2
NewVHDPath =
" D:\Hyper-V\$VMName\$VMName.vhdx"
NewVHDSizeBytes = 53687091200
BootDevice =
"VHD"
Path =
" D:\Hyper-V\$VMName "
SwitchName = (
get-vmswitch
).Name[0]
}
New-VM
@VM
|
本文介绍如何使用 PowerShell 进行 Hyper-V 的管理操作,包括列出 Hyper-V PowerShell 模块、显示运行中及已关闭的虚拟机,并提供创建虚拟机的具体步骤。


4261

被折叠的 条评论
为什么被折叠?



