Merge pull request #720 from Romanitho/fix
Fix missing settings during MSI update settings migrationpull/722/head
commit
4bc17051a2
|
@ -29,6 +29,11 @@ function Update-WAU {
|
||||||
New-Item -Path $destinationPath -ItemType Directory -Force
|
New-Item -Path $destinationPath -ItemType Directory -Force
|
||||||
Write-ToLog "New registry key created."
|
Write-ToLog "New registry key created."
|
||||||
}
|
}
|
||||||
|
#Create missing default values
|
||||||
|
Set-ItemProperty -Path $destinationPath -Name "WAU_DoNotRunOnMetered" -Value 1 -Type Dword
|
||||||
|
Write-ToLog "WAU_DoNotRunOnMetered created. Value: 1"
|
||||||
|
Set-ItemProperty -Path $destinationPath -Name "WAU_UpdatesAtLogon" -Value 0 -Type Dword
|
||||||
|
Write-ToLog "WAU_UpdatesAtLogon created. Value 0"
|
||||||
#Retrieve the properties of the source key
|
#Retrieve the properties of the source key
|
||||||
$properties = Get-ItemProperty -Path $sourcePath
|
$properties = Get-ItemProperty -Path $sourcePath
|
||||||
foreach ($property in $properties.PSObject.Properties) {
|
foreach ($property in $properties.PSObject.Properties) {
|
||||||
|
@ -36,7 +41,7 @@ function Update-WAU {
|
||||||
if ($property.Name -like "WAU_*" -and $property.Name -notlike "WAU_PostUpdateActions*") {
|
if ($property.Name -like "WAU_*" -and $property.Name -notlike "WAU_PostUpdateActions*") {
|
||||||
#Copy the value to the destination key
|
#Copy the value to the destination key
|
||||||
Set-ItemProperty -Path $destinationPath -Name $property.Name -Value $property.Value
|
Set-ItemProperty -Path $destinationPath -Name $property.Name -Value $property.Value
|
||||||
Write-ToLog "$($property.Name) saved."
|
Write-ToLog "$($property.Name) saved. Value: $($property.Value)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue