Skip to content

Commit

Permalink
Merge pull request #605 from michbern-ms/user/michbern/ps7
Browse files Browse the repository at this point in the history
Install PSDesiredStateConfiguration module if it is not installed
  • Loading branch information
jaromirk authored Oct 5, 2024
2 parents dc61e06 + 6f5e4b6 commit d1b3898
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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

0 comments on commit d1b3898

Please sign in to comment.