Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install PSDesiredStateConfiguration module if it is not installed #605

Merged
merged 8 commits into from
Oct 5, 2024
12 changes: 12 additions & 0 deletions Scripts/1_Prereq.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ function Get-WindowsBuildNumber {

#endregion

#region Installing PSDesiredStateConfiguration from the PowerShell gallery

# See https://learn.microsoft.com/en-us/powershell/dsc/overview?view=dsc-2.0 for details
# on the breaking change that requires this module to be installed.
WriteInfoHighlighted "Testing if PSDesiredStateConfiguration is present"
if (!(Get-Module -ListAvailable -Name PSDesiredStateConfiguration)) {
WriteInfo "`t Module PSDesiredStateConfiguration not found... Downloading"
Install-Module -Name PSDesiredStateConfiguration -Repository PSGallery -MaximumVersion 2.99
}

#endregion

#region Downloading required Posh Modules
# Downloading modules into Temp folder if needed.

Expand Down
4 changes: 2 additions & 2 deletions Scripts/2_CreateParentDisks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1251,11 +1251,11 @@ If (-not $isAdmin) {
$vhdProperties['vhd.os.language'] = $OSLanguage
}
}
$events += New-TelemetryEvent -Event "CreateParentDisks.Vhd" -Metrics $vhdMetrics -Properties $vhdProperties -NickName $LabConfig.TelemetryNickName
$events += Initialize-TelemetryEvent -Event "CreateParentDisks.Vhd" -Metrics $vhdMetrics -Properties $vhdProperties -NickName $LabConfig.TelemetryNickName
}

# and one overall
$events += New-TelemetryEvent -Event "CreateParentDisks.End" -Metrics $metrics -Properties $properties -NickName $LabConfig.TelemetryNickName
$events += Initialize-TelemetryEvent -Event "CreateParentDisks.End" -Metrics $metrics -Properties $properties -NickName $LabConfig.TelemetryNickName

Send-TelemetryEvents -Events $events | Out-Null
}
Expand Down