Skip to content

Commit

Permalink
fix(CLIENTCBS): check all of SystemApps
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jul 16, 2024
1 parent 9ef059f commit c695c0d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/playbook/Executables/CLIENTCBS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

# Variables
$windir = [Environment]::GetFolderPath('Windows')
$cbsPublic = "$windir\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\Public"
$settingsExtensions = "$cbsPublic\wsxpacks\Account\SettingsExtensions.json"
$settingsExtensions = (Get-ChildItem "$windir\SystemApps" -Recurse).FullName | Where-Object { $_ -like '*wsxpacks\Account\SettingsExtensions.json*' }
$arm = ((Get-CimInstance -Class Win32_ComputerSystem).SystemType -match 'ARM64') -or ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64')
if (!(Test-Path $settingsExtensions)) {
if ($settingsExtensions.Count -eq 0) {
Write-Output "Settings extensions ($settingsExtensions) not found."
Write-Output "User is likely on Windows 10, nothing to do. Exiting..."
exit
Expand All @@ -37,7 +36,10 @@ function Find-VelocityID($Node) {

return $ids
}
$ids = Find-VelocityID -Node $(Get-Content -Path $settingsExtensions | ConvertFrom-Json)
$ids = @()
foreach ($settingsJson in $settingsExtensions) {
$ids += Find-VelocityID -Node $(Get-Content -Path $settingsJson | ConvertFrom-Json)
}

# No IDs check
if ($ids.Count -le 0) {
Expand Down

0 comments on commit c695c0d

Please sign in to comment.