Skip to content

Commit

Permalink
fix(PFP): remove per-user stuf
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Oct 6, 2024
1 parent 09c350c commit db45c40
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/playbook/Configuration/tweaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ actions:
- !task: {path: 'tweaks\scripts\script-core-isolation.yml'}
- !task: {path: 'tweaks\scripts\script-mitigations.yml'}
- !task: {path: 'tweaks\scripts\script-devices.yml'}
- !task: {path: 'tweaks\scripts\script-pfp.yml'}
- !task: {path: 'tweaks\scripts\script-backup2.yml'}
- !task: {path: 'tweaks\scripts\script-clientcbs.yml'}

Expand Down
8 changes: 8 additions & 0 deletions src/playbook/Configuration/tweaks/scripts/script-pfp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Set Profile Pictures
description: Sets the default Atlas profile pictures
actions:
- !powerShell:
command: '.\PFP.ps1'
exeDir: true
wait: true
23 changes: 23 additions & 0 deletions src/playbook/Executables/PFP.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Add-Type -AssemblyName System.Drawing
$img = [System.Drawing.Image]::FromFile((Get-Item '.\user.png'))

$resolutions = @{
"user.png" = 448
"user.bmp" = 448
"guest.png" = 448
"guest.bmp" = 448
"user-192.png" = 192
"user-48.png" = 48
"user-40.png" = 40
"user-32.png" = 32
}

# Set default profile pictures
foreach ($image in $resolutions.Keys) {
$resolution = $resolutions[$image]

$a = New-Object System.Drawing.Bitmap($resolution, $resolution)
$graph = [System.Drawing.Graphics]::FromImage($a)
$graph.DrawImage($img, 0, 0, $resolution, $resolution)
$a.Save("$([Environment]::GetFolderPath('CommonApplicationData'))\Microsoft\User Account Pictures\$image")
}

0 comments on commit db45c40

Please sign in to comment.