Skip to content

Commit 95a74e1

Browse files
authored
Merge pull request #454 from microsoft/dev
Dev
2 parents 539cd1c + 1acfcda commit 95a74e1

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

Scripts/2_CreateParentDisks.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,11 +1108,15 @@ If (-not $isAdmin) {
11081108
#region finishing
11091109
WriteSuccess "Script finished at $(Get-date) and took $(((get-date) - $StartDateTime).TotalMinutes) Minutes"
11101110

1111-
WriteInfoHighlighted "Do you want to cleanup unnecessary files and folders? Deault (Y)"
1112-
WriteInfo "`t (.\Temp\ 1_Prereq.ps1 2_CreateParentDisks.ps1 and rename 3_deploy to just deploy)"
1113-
If ((Read-host "`t Please type Y or N") -like "*N"){
1111+
$options = [System.Management.Automation.Host.ChoiceDescription[]] @(
1112+
<# 0 #> New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", "Cleanup .\Temp\ 1_Prereq.ps1 2_CreateParentDisks.ps1 and rename 3_deploy.ps1 to just deploy.ps1"
1113+
<# 1 #> New-Object System.Management.Automation.Host.ChoiceDescription "&No", "Keep files (in case DC was not created sucessfully)"
1114+
)
1115+
$response = $host.UI.PromptForChoice("Unnecessary files cleanup","Do you want to cleanup unnecessary files and folders?", $options, 0 <#default option#>)
1116+
1117+
If ($response -eq 1){
11141118
$renamed = $false
1115-
WriteInfo "`t You typed N, skipping cleanup"
1119+
WriteInfo "Skipping cleanup"
11161120
}else{
11171121
$renamed = $true
11181122
WriteInfo "`t `t Cleaning unnecessary items"

Scripts/3_Deploy.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,9 @@ If (-not $isAdmin) {
15751575
} elseif($LabConfig.AutoStartAfterDeploy -eq "DeployedOnly") {
15761576
$startVMs = 2
15771577
}
1578-
1578+
1579+
$CheckPointTime=Get-Date
1580+
15791581
if(-not $LabConfig.ContainsKey("AutoStartAfterDeploy") -and $AllVMs.Count -gt 0) {
15801582
$options = [System.Management.Automation.Host.ChoiceDescription[]] @(
15811583
<# 0 #> New-Object System.Management.Automation.Host.ChoiceDescription "&No", "No VM will be started."
@@ -1610,7 +1612,7 @@ If (-not $isAdmin) {
16101612
if((Get-TelemetryLevel) -in $TelemetryEnabledLevels) {
16111613
WriteInfo "Sending telemetry info"
16121614
$metrics = @{
1613-
'script.duration' = [Math]::Round(((Get-Date) - $StartDateTime).TotalSeconds, 2)
1615+
'script.duration' = [Math]::Round(($CheckPointTime - $StartDateTime).TotalSeconds, 2)
16141616
'lab.vmsCount.active' = ($AllVMs | Measure-Object).Count # how many VMs are running
16151617
'lab.vmsCount.provisioned' = ($provisionedVMs | Measure-Object).Count # how many VMs were created by this script run
16161618
}
@@ -1626,7 +1628,7 @@ If (-not $isAdmin) {
16261628
}
16271629

16281630
#write how much it took to deploy
1629-
WriteInfo "Script finished at $(Get-Date) and took $(((Get-Date) - $StartDateTime).TotalMinutes) Minutes"
1631+
WriteInfo "Script finished at $CheckPointTime and took $(($CheckPointTime - $StartDateTime).TotalMinutes) Minutes"
16301632

16311633
Stop-Transcript
16321634

Scripts/LabConfig.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'M
1616
#region Same as above, but with more explanation
1717
<#
1818
$LabConfig=@{
19-
DomainAdminName='LabAdmin'; # Used during 2_CreateParentDisks (no affect if changed after this step)
20-
AdminPassword='LS1setup!'; # Used during 2_CreateParentDisks. If changed after, it will break the functionality of 3_Deploy.ps1
21-
Prefix = 'MSLab-'; # (Optional) All VMs and vSwitch are created with this prefix, so you can identify the lab. If not specified, Lab folder name is used
22-
SwitchName = 'LabSwitch'; # (Optional) Name of vSwitch
23-
SwitchNICs = 'NIC1",NIC2" ; # (Optional) Adds these NICs to vSwitch (without connecting hostOS).
19+
DomainAdminName="LabAdmin"; # Used during 2_CreateParentDisks (no affect if changed after this step)
20+
AdminPassword="LS1setup!"; # Used during 2_CreateParentDisks. If changed after, it will break the functionality of 3_Deploy.ps1
21+
Prefix = "MSLab-"; # (Optional) All VMs and vSwitch are created with this prefix, so you can identify the lab. If not specified, Lab folder name is used
22+
SwitchName = "LabSwitch"; # (Optional) Name of vSwitch
23+
SwitchNICs = "NIC1","NIC2"; # (Optional) Adds these NICs to vSwitch (without connecting hostOS).
2424
SecureBoot=$true; # (Optional) Useful when testing unsigned builds (Useful for MS developers for daily builds)
25-
DCEdition='4'; # 4 for DataCenter or 3 for DataCenterCore
26-
InstallSCVMM='No'; # (Optional) Yes/Prereqs/SQL/ADK/No
25+
DCEdition="4"; # 4 for DataCenter or 3 for DataCenterCore
26+
InstallSCVMM="No"; # (Optional) Yes/Prereqs/SQL/ADK/No
2727
AdditionalNetworksInDC=$false; # (Optional) If Additional networks should be added also to DC
2828
DomainNetbiosName="Corp"; # (Optional) If set, custom domain NetBios name will be used. if not specified, Default "corp" will be used
2929
DomainName="Corp.contoso.com"; # (Optional) If set, custom DomainName will be used. If not specified, Default "Corp.contoso.com" will be used

0 commit comments

Comments
 (0)