Skip to content

Commit f20e9a7

Browse files
Michael Bernstein (DPLAT)Michael Bernstein (DPLAT)
authored andcommitted
Fix issue with extra objects returning from Hydrate-DC
1 parent 6db3293 commit f20e9a7

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

Scripts/0_DCHydrate.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,5 @@ function Hydrate-DC {
626626
$DC | Get-VMNetworkAdapter | Disconnect-VMNetworkAdapter
627627

628628
$dcHydrationEndTime = Get-Date
629-
Return $DC
630629
}
631630
#endregion

Scripts/2_CreateParentDisks.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ if (-not $DCFilesExists){
525525
#region create DC if it does not exist
526526
if (-not $DCFilesExists) {
527527
if (-not $LabConfig.NoDehydrateDC){
528-
$DC = Hydrate-DC -DCName $DCName -VhdPath $vhdpath -VmPath $VmPath -SwitchName $HydrationSwitchname -TimeZone $TimeZone -DhcpScope $LabConfig.DHCPscope -AdminPassword $AdminPassword
528+
Hydrate-DC -DCName $DCName -VhdPath $vhdpath -VmPath $VmPath -SwitchName $Switchname -TimeZone $TimeZone -DhcpScope $LabConfig.DHCPscope -AdminPassword $AdminPassword
529+
$DC=Get-VM -Name $DCName
529530
if ($DC -eq $null){
530531
WriteErrorAndExit "DC was not created successfully Press any key to continue ..."
531532
} else {

Scripts/3_Deploy.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,8 @@ If (-not $isAdmin) {
12071207
$VMPath="$PSScriptRoot\LAB\"
12081208
$HydrationSwitchname="DC_HydrationSwitch_$([guid]::NewGuid())"
12091209

1210-
$DC = Hydrate-DC -DCName $DCName -VhdPath $vhdpath -VMPath $VMPath -Switchname $HydrationSwitchname -TimeZone $TimeZone -DHCPScope $LabConfig.DHCPscope -AdminPassword $LabConfig.AdminPassword
1210+
Hydrate-DC -DCName $DCName -VhdPath $vhdpath -VMPath $VMPath -Switchname $HydrationSwitchname -TimeZone $TimeZone -DHCPScope $LabConfig.DHCPscope -AdminPassword $LabConfig.AdminPassword
1211+
$DC=Get-VM -Name $DCName
12111212
if ($DC -eq $null){
12121213
WriteErrorAndExit "DC was not created successfully Press any key to continue ..."
12131214
} else {

0 commit comments

Comments
 (0)