17 lines
839 B
PowerShell
17 lines
839 B
PowerShell
# Fix GPP shortcuts to use %DesktopDir% (per-user, deployed at logon by GPO)
|
|
$kioskGuid = (Get-GPO -Name 'CSC - Nurse Station Kiosk').Id
|
|
$xmlPath = "\\cascades.local\SYSVOL\cascades.local\Policies\{$kioskGuid}\User\Preferences\Shortcuts\Shortcuts.xml"
|
|
$xml = Get-Content $xmlPath -Raw
|
|
$xml = $xml -replace '%CommonDesktopDir%', '%DesktopDir%'
|
|
Set-Content $xmlPath $xml -Encoding UTF8 -Force
|
|
Write-Output "Changed shortcuts to %DesktopDir%"
|
|
# Bump version
|
|
$gptPath = "\\cascades.local\SYSVOL\cascades.local\Policies\{$kioskGuid}\GPT.INI"
|
|
$ini = Get-Content $gptPath -Raw
|
|
if ($ini -match 'Version=(\d+)') {
|
|
$ver = [int]$matches[1]; $newVer = ((($ver -shr 16)+1) -shl 16) -bor ($ver -band 0xFFFF)
|
|
$ini = $ini -replace "Version=\d+", "Version=$newVer"
|
|
Set-Content $gptPath $ini -Force
|
|
Write-Output "Version: $ver -> $newVer"
|
|
}
|