Powershell从批量创建虚拟机

Powershell从批量创建虚拟机,powershell,hyper-v,bulk,Powershell,Hyper V,Bulk,我想从批量(CVS)创建一些VM 使用此选项(我使用此脚本创建VM,并希望批量输入这些内容[如VM名称、磁盘路径和RAM等]) 我想做大量的事情,这样我可以改变 虚拟机名称 内存启动字节 新路径 (虚拟机的)路径 新vhdsizebytes 处理器计数 最小单核细胞 StartupBytes 最大单核细胞 优先级80和缓冲区50-->此值不变 VMDVD驱动器 开关名 只需要一个脚本,它将从CVS中获取所有这些数据,并像我编写的脚本一样创建这个虚拟机 我知道互联网上有十亿个指南,但在这里

我想从批量(CVS)创建一些VM 使用此选项(我使用此脚本创建VM,并希望批量输入这些内容[如VM名称、磁盘路径和RAM等])

我想做大量的事情,这样我可以改变

  • 虚拟机名称
  • 内存启动字节
  • 新路径
  • (虚拟机的)路径
  • 新vhdsizebytes
  • 处理器计数
  • 最小单核细胞
  • StartupBytes
  • 最大单核细胞
优先级80和缓冲区50-->此值不变

  • VMDVD驱动器
  • 开关名
只需要一个脚本,它将从CVS中获取所有这些数据,并像我编写的脚本一样创建这个虚拟机

我知道互联网上有十亿个指南,但在这里我总能找到最好的解决方案。
谢谢

这是一件很常见的事情,有大量的预构建脚本可以根据您的用例的需要进行利用和/或调整

此脚本已被弃用。它已被重新编写并成为一部分 SBPS模块的可用性

在这里。http://gallery.technet.microsoft.com/scriptcenter/SBTools-module-adds-38992422NAME

用于创建Hyper-V虚拟机的新SBVM概要功能

下载:

此快速而肮脏的PowerShell脚本在虚拟机上创建虚拟机 Windows Server 2012 Hyper-V主机。这是完美的,如果你需要 在实验室或演示环境中创建大量虚拟机

下载:

甚至可以通过Microsfot powershellgallery.com预构建模块来构建批量VMlabs

Find-Module -Name '*lab*' | Format-Table -AutoSize
# Results
<#
 Find-Module -Name '*lab*' | Format-Table -AutoSize

Version   Name                              Repository Description                                                                                                    
-------   ----                              ---------- -----------                                                                                                    
...                                          
5.22.0    AutomatedLab                      PSGallery  The module creates a Hyper-V visual lab automatically as defined in the XML files.                             
2.0.208   AutomatedLab.Common               PSGallery  The module collects all helper functions used in but not limited to AutomatedLab                               
...          
1.0.5.105 LabBuilder                        PSGallery  Builds Hyper-V Windows multi-machine/Active Directory labs using XML configuration files and DSC Resources.    
...
#>
Find Module-Name'*lab*'| Format Table-AutoSize
#结果

问题是什么?在第一行------->我想使用此选项从批量(CVS)创建一些VM(我使用此脚本创建VM,我想批量输入这些内容[如VM名称、磁盘路径和RAM等]),很抱歉,这不是问题。同意Doug Mauer的意见。这是一个脚本请求,不是代码问题。规则也是如此然而,你在寻找什么?仅使用您的文章标题,就可以为您的用例找到大量的文章/示例/示例代码。
Find-Module -Name '*lab*' | Format-Table -AutoSize
# Results
<#
 Find-Module -Name '*lab*' | Format-Table -AutoSize

Version   Name                              Repository Description                                                                                                    
-------   ----                              ---------- -----------                                                                                                    
...                                          
5.22.0    AutomatedLab                      PSGallery  The module creates a Hyper-V visual lab automatically as defined in the XML files.                             
2.0.208   AutomatedLab.Common               PSGallery  The module collects all helper functions used in but not limited to AutomatedLab                               
...          
1.0.5.105 LabBuilder                        PSGallery  Builds Hyper-V Windows multi-machine/Active Directory labs using XML configuration files and DSC Resources.    
...
#>