forked from weeyin83/Lab-Deployment-in-Azure
-
Notifications
You must be signed in to change notification settings - Fork 1
/
InstallHyperV.ps1
30 lines (22 loc) · 1.02 KB
/
InstallHyperV.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<#
Microsoft Lab Environment
.File Name
- InstallHyperV.ps1
.What calls this script?
- This is a PowerShell DSC run as a Custom Script extention called by VMdeploy.json
.What does this script do?
- Configures PowerShell to use TLS1.2 to download the NuGet package as per the PowerShell galleries security standards
- Downloads NuGet package provider
- Installs the DscResource and xHyper-V PS modules in support of the upcoming DSC Extenion run in HyperVHostConfig.ps1
- Installs Hyper-V with all Features and Management Tools and then Restarts the Machine
#>
Set-ExecutionPolicy Unrestricted -Force
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -Force
Find-Module -Includes DscResource -Name xHyper-v | Install-Module -Force
#Install Hyper-V and Reboot
Install-WindowsFeature -Name Hyper-V `
-IncludeAllSubFeature `
-IncludeManagementTools `
-Verbose `
-Restart