Skip to content

Commit f6e1d75

Browse files
authored
Chore: Minimal improvements for v0.6.1 (#16)
* chore: basic improvements for v0.6.1 ## [0.6.1] - 2026-02-17 ### Added - Intune enrollment detection: Windows hardening is now skipped if the device is already enrolled in Intune. - Dedicated section for the Windows Spotlight fix under "Windows tweaks" with user instructions and reference to Fix-Spotlight.ps1. ### Changed - Office/M365 is no longer installed via Winget if an Office or M365 package is already detected on the system. - Dropped support for Windows 11 24H2; only 25H2+ (build 26200+) is now supported. - Driver lists for Dell and HP are now embedded directly in the script for improved reliability (no more external JSON files). - Application installation output now shows both the app name and its alias/ID for improved clarity. - Theme configuration logging/output has been cleaned up to avoid duplicate or confusing messages. - Hostname script now provides a clear message if no serial number is found (e.g., in a VM). ### Fixed - Improved error handling for missing serial number during hostname setup. - Various minor improvements to logging, error handling, and user messages. * Update CHANGELOG.md * Enhance scripts - Added warning message for BitLocker activation in Harden-Windows.ps1. - Implemented improved detection for Microsoft Office installations in Install-Applications.ps1. - Updated output messages for clarity in Remove-Bloat.ps1, Set-HostName.ps1, and Set-Theme.ps1.
1 parent 001b02d commit f6e1d75

File tree

12 files changed

+150
-149
lines changed

12 files changed

+150
-149
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## [0.6.1] - 2026-02-17
11+
12+
### Added
13+
- Intune enrollment detection: Windows hardening is now skipped if the device is already enrolled in Intune.
14+
- Dedicated section for the Windows Spotlight fix under "Windows tweaks" with user instructions and reference to Fix-Spotlight.ps1.
15+
16+
### Changed
17+
- Office/M365 is no longer installed via Winget if an Office or M365 package is already detected on the system.
18+
- Dropped support for Windows 11 24H2; only 25H2+ (build 26200+) is now supported.
19+
- Driver lists for Dell and HP are now embedded directly in the script for improved reliability (no more external JSON files).
20+
- Application installation output now shows both the app name and its alias/ID for improved clarity.
21+
- Theme configuration logging/output has been cleaned up to avoid duplicate or confusing messages.
22+
- Hostname script now provides a clear message if no serial number is found (e.g., in a VM).
23+
24+
### Fixed
25+
- Improved error handling for missing serial number during hostname setup.
26+
- Various minor improvements to logging, error handling, and user messages.
27+
28+
---
29+
1030
## [0.6.0] - 2026-02-02
1131

1232
### Changed
@@ -165,6 +185,8 @@ First open-source release of WinDeploy - Windows Deployment Automation Toolkit.
165185

166186
---
167187

188+
189+
[0.6.1]: https://github.com/Stensel8/WinDeploy/releases/tag/v0.6.1
168190
[0.6.0]: https://github.com/Stensel8/WinDeploy/releases/tag/v0.6.0
169191
[0.5.5]: https://github.com/Stensel8/WinDeploy/releases/tag/v0.5.5
170192
[0.5.4]: https://github.com/Stensel8/WinDeploy/releases/tag/v0.5.4

Docs/SupportedDellDevices.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

Docs/SupportedHPDevices.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Sten Tijhuis (Stensel8) and Contributors
3+
Copyright (c) 2025 - 2026 Sten Tijhuis (Stensel8) and Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66
[![PowerShell 7.0+](https://img.shields.io/badge/PowerShell-7.0+-blue.svg)](https://github.com/PowerShell/PowerShell)
77
[![Windows 11](https://img.shields.io/badge/Windows-11-0078D6.svg)](https://www.microsoft.com/windows)
8-
[![Windows 24H2/25H2](https://img.shields.io/badge/Windows-24H2/25H2-0078D6.svg)](https://www.microsoft.com/windows)
8+
[![Windows 25H2](https://img.shields.io/badge/Windows-25H2-0078D6.svg)](https://www.microsoft.com/windows)
99

1010

1111
[![PSScriptAnalyzer](https://github.com/Stensel8/WinDeploy/actions/workflows/powershell.yml/badge.svg)](https://github.com/Stensel8/WinDeploy/actions/workflows/powershell.yml)
@@ -40,7 +40,7 @@ Choose how you want to deploy WinDeploy — pick the path that fits your environ
4040

4141
## Quick Start
4242

43-
**Prerequisites:** Windows 11 Pro 24H2+, PowerShell 7, internet connection
43+
**Prerequisites:** Windows 11 Pro 25H2+, PowerShell 7, internet connection
4444

4545
### Option 1: USB Deployment (Fresh installs)
4646
1. Create bootable Windows 11 USB

Scripts/Deployment/Harden-Windows.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,36 @@
1010
Set-StrictMode -Version Latest
1111
$ErrorActionPreference = 'Continue'
1212

13+
# Check for Intune enrollment (pre-check)
14+
function Test-IntuneEnrollment {
15+
$enrollments = Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Enrollments' -ErrorAction SilentlyContinue
16+
if ($enrollments.Count -eq 0) { return $false }
17+
foreach ($enrollment in $enrollments) {
18+
$guid = $enrollment.PSChildName
19+
$erm = "HKLM:\SOFTWARE\Microsoft\EnterpriseResourceManager\Tracked\$guid"
20+
$policy = "HKLM:\SOFTWARE\Microsoft\PolicyManager\Providers\$guid"
21+
$omadm = "HKLM:\SOFTWARE\Microsoft\Provisioning\OMADM\Accounts\$guid"
22+
$task = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\EnterpriseMgmt\$guid"
23+
if ((Test-Path $erm) -and (Test-Path $policy) -and (Test-Path $omadm) -and (Test-Path $task)) {
24+
return $true
25+
}
26+
}
27+
return $false
28+
}
29+
30+
if (Test-IntuneEnrollment) {
31+
Write-Output "Device is already enrolled in Intune. Skipping hardening."
32+
exit 0
33+
}
34+
35+
# Only support Windows 11 25H2+ (build 26200+)
36+
$os = Get-CimInstance Win32_OperatingSystem
37+
$build = [int]$os.BuildNumber
38+
if ($build -lt 26200) {
39+
Write-Output "ERROR: Only Windows 11 25H2 (build 26200+) and newer are supported. Current build: $build. Exiting."
40+
exit 1
41+
}
42+
1343
Function Write-DeployLog {
1444
param([string]$Message, [switch]$IsError)
1545
$logDir = "C:\WinDeploy\Logs"
@@ -135,6 +165,7 @@ try {
135165
if ($bitLockerStatus.ProtectionStatus -eq "Off") {
136166
Enable-BitLocker -MountPoint "C:" -TpmProtector -EncryptionMethod XtsAes256 -UsedSpaceOnly -ErrorAction Stop
137167
$appliedConfigs += "BitLocker encryption started"
168+
Write-Output "WARNING: BitLocker will be enabled after the next reboot. Make sure to export your BitLocker recovery key!"
138169
} else {
139170
$appliedConfigs += "BitLocker already active"
140171
}

Scripts/Deployment/Install-Applications.ps1

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ Function Write-DeployLog {
2222

2323
try {
2424

25+
2526
$Applications = @(
26-
"Microsoft.VCRedist.2015+.x64",
27-
"Microsoft.Office",
28-
#"Adobe.Acrobat.Reader.64-bit", #Uncomment if you need Adobe Reader
29-
"Microsoft.Teams",
30-
"Microsoft.OneDrive",
31-
"7zip.7zip",
32-
"Microsoft.WindowsApp"
33-
#"Microsoft.CompanyPortal" - Problematic package at this moment. Microsoft messed up the package. Use msstore version below instead. (exit code -2147024894)
27+
@{Alias="Microsoft.VCRedist.2015+.x64"; Name="Microsoft Visual C++ 2015+ x64 Redistributable"},
28+
@{Alias="Microsoft.Office"; Name="Microsoft Office"},
29+
#@{Alias="Adobe.Acrobat.Reader.64-bit"; Name="Adobe Acrobat Reader 64-bit"},
30+
@{Alias="Microsoft.Teams"; Name="Microsoft Teams"},
31+
@{Alias="Microsoft.OneDrive"; Name="Microsoft OneDrive"},
32+
@{Alias="7zip.7zip"; Name="7-Zip"},
33+
@{Alias="Microsoft.WindowsApp"; Name="Windows App"}
34+
#@{Alias="Microsoft.CompanyPortal"; Name="Company Portal"} # Problematic package at this moment.
3435
)
3536

3637
#Note: Some applications fail to install. This is why we have a separate list for msstore apps.
3738
$MsStoreApplications = @(
38-
#"XPDP273C0XHQH2", #Adobe Acrobat Reader (msstore) #Uncomment if you need Adobe Reader
39-
"XP8BT8DW290MPQ", # Microsoft Teams (msstore)
40-
"9N1F85V9T8BN", # Windows App (msstore)
41-
"9WZDNCRFJ3PZ", # Company Portal (msstore)
42-
"9MZ95KL8MR0L" # Install this Windows app for improved screenshotting and recording capabilities.
39+
@{Alias="XP8BT8DW290MPQ"; Name="Microsoft Teams (msstore)"},
40+
@{Alias="9N1F85V9T8BN"; Name="Windows App (msstore)"},
41+
@{Alias="9WZDNCRFJ3PZ"; Name="Company Portal (msstore)"},
42+
@{Alias="9MZ95KL8MR0L"; Name="Screenshot/Recording App (msstore)"}
4343
)
4444

4545
# Winget error codes that you may come across during installation. Note that these are not documented all well by Micrsoft. They documenent some of them, but not all.
@@ -251,31 +251,53 @@ try {
251251
$OfficeFailed = $false
252252

253253
foreach ($app in $Applications) {
254-
Write-DeployLog "Installing $app..."
254+
$alias = $app.Alias
255+
$name = $app.Name
256+
# Improved Office detection
257+
if ($alias -eq "Microsoft.Office") {
258+
$officeDetected = $false
259+
# Check registry for Office/M365
260+
$officeRegPaths = @(
261+
"HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration",
262+
"HKLM:\SOFTWARE\Microsoft\Office\16.0\Common\InstallRoot",
263+
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
264+
)
265+
foreach ($regPath in $officeRegPaths) {
266+
if (Test-Path $regPath) {
267+
$officeDetected = $true
268+
break
269+
}
270+
}
271+
# Check installed products via CIM
272+
$officeCim = Get-CimInstance -ClassName Win32_Product -Filter "Name LIKE '%Office%' OR Name LIKE '%Microsoft 365%'" -ErrorAction SilentlyContinue
273+
if ($officeCim) {
274+
$officeDetected = $true
275+
}
276+
if ($officeDetected) {
277+
Write-DeployLog "Office/M365 already detected on system. Skipping $name ($alias) installation."
278+
continue
279+
}
280+
}
281+
Write-DeployLog "Installing $name ($alias)..."
255282
try {
256-
$output = & winget install --id $app --accept-package-agreements --accept-source-agreements 2>&1
283+
$output = & winget install --id $alias --accept-package-agreements --accept-source-agreements 2>&1
257284
$exitCode = $LASTEXITCODE
258285
if ($exitCode -eq 0 -or $output -match "already installed|No available upgrade") {
259-
Write-DeployLog "Installed $app"
286+
Write-DeployLog "Installed $name ($alias)"
260287
} else {
261288
$description = $WingetErrorDescriptions[$exitCode]
262-
263289
if ($description) {
264-
265-
Write-DeployLog "Failed to install $app - $description (exit code $exitCode)" -IsError
266-
290+
Write-DeployLog "Failed to install $name ($alias) - $description (exit code $exitCode)" -IsError
267291
} else {
268-
269-
Write-DeployLog "Failed to install $app (exit code $exitCode)" -IsError
270-
292+
Write-DeployLog "Failed to install $name ($alias) (exit code $exitCode)" -IsError
271293
}
272-
if ($app -eq "Microsoft.Office") {
294+
if ($alias -eq "Microsoft.Office") {
273295
$OfficeFailed = $true
274296
}
275297
}
276298
} catch {
277-
Write-DeployLog "Failed to install $app" -IsError
278-
if ($app -eq "Microsoft.Office") {
299+
Write-DeployLog "Failed to install $name ($alias)" -IsError
300+
if ($alias -eq "Microsoft.Office") {
279301
$OfficeFailed = $true
280302
}
281303
}
@@ -331,27 +353,24 @@ try {
331353

332354
Write-DeployLog "Installing Microsoft Store versions of the applications listed above..."
333355
foreach ($app in $MsStoreApplications) {
334-
Write-DeployLog "Installing msstore $app..."
356+
$alias = $app.Alias
357+
$name = $app.Name
358+
Write-DeployLog "Installing msstore $name ($alias)..."
335359
try {
336-
$output = & winget install --id $app --accept-package-agreements --accept-source-agreements 2>&1
360+
$output = & winget install --id $alias --accept-package-agreements --accept-source-agreements 2>&1
337361
$exitCode = $LASTEXITCODE
338362
if ($exitCode -eq 0 -or $output -match "already installed|No available upgrade") {
339-
Write-DeployLog "Installed msstore $app"
363+
Write-DeployLog "Installed msstore $name ($alias)"
340364
} else {
341365
$description = $WingetErrorDescriptions[$exitCode]
342-
343366
if ($description) {
344-
345-
Write-DeployLog "Failed to install msstore $app - $description (exit code $exitCode)" -IsError
346-
367+
Write-DeployLog "Failed to install msstore $name ($alias) - $description (exit code $exitCode)" -IsError
347368
} else {
348-
349-
Write-DeployLog "Failed to install msstore $app (exit code $exitCode)" -IsError
350-
369+
Write-DeployLog "Failed to install msstore $name ($alias) (exit code $exitCode)" -IsError
351370
}
352371
}
353372
} catch {
354-
Write-DeployLog "Failed to install msstore $app" -IsError
373+
Write-DeployLog "Failed to install msstore $name ($alias)" -IsError
355374
}
356375
}
357376

Scripts/Deployment/Install-Drivers.ps1

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -29,68 +29,14 @@ try {
2929

3030
Write-DeployLog "System: $manufacturer $model"
3131

32-
# Load supported devices
33-
$supportedDellDevices = @()
34-
$supportedHPDevices = @()
3532

36-
$version = "testing"
37-
38-
$dellPath = "C:\WinDeploy\Download\SupportedDellDevices.json"
39-
$hpPath = "C:\WinDeploy\Download\SupportedHPDevices.json"
40-
41-
# Ensure download directory exists
42-
$downloadDir = Split-Path $dellPath
43-
if (!(Test-Path $downloadDir)) {
44-
New-Item -ItemType Directory -Path $downloadDir -Force | Out-Null
45-
}
46-
47-
# Try to copy from local repo first
48-
$dellLocal = Join-Path $PSScriptRoot "..\..\Docs\SupportedDellDevices.json"
49-
$hpLocal = Join-Path $PSScriptRoot "..\..\Docs\SupportedHPDevices.json"
50-
51-
if (Test-Path $dellLocal) {
52-
Copy-Item $dellLocal $dellPath -Force
53-
Write-DeployLog "Copied SupportedDellDevices.json from local repo"
54-
} elseif (!(Test-Path $dellPath)) {
55-
$url = "https://raw.githubusercontent.com/Stensel8/WinDeploy/$version/Docs/SupportedDellDevices.json"
56-
try {
57-
Invoke-WebRequest -Uri $url -OutFile $dellPath -UseBasicParsing -ErrorAction Stop
58-
Write-DeployLog "Downloaded SupportedDellDevices.json"
59-
} catch {
60-
Write-Warning "Failed to download SupportedDellDevices.json"
61-
}
62-
}
63-
64-
if (Test-Path $hpLocal) {
65-
Copy-Item $hpLocal $hpPath -Force
66-
Write-DeployLog "Copied SupportedHPDevices.json from local repo"
67-
} elseif (!(Test-Path $hpPath)) {
68-
$url = "https://raw.githubusercontent.com/Stensel8/WinDeploy/$version/Docs/SupportedHPDevices.json"
69-
try {
70-
Invoke-WebRequest -Uri $url -OutFile $hpPath -UseBasicParsing -ErrorAction Stop
71-
Write-DeployLog "Downloaded SupportedHPDevices.json"
72-
} catch {
73-
Write-Warning "Failed to download SupportedHPDevices.json"
74-
}
75-
}
76-
77-
if (Test-Path $dellPath) {
78-
try {
79-
$supportedDellDevices = Get-Content $dellPath -Raw | ConvertFrom-Json | Where-Object { -not $_.StartsWith("//") }
80-
Write-DeployLog "Loaded Dell list from $dellPath"
81-
} catch {
82-
Write-Warning "Failed to load Dell device list"
83-
}
84-
}
85-
86-
if (Test-Path $hpPath) {
87-
try {
88-
$supportedHPDevices = Get-Content $hpPath -Raw | ConvertFrom-Json | Where-Object { -not $_.StartsWith("//") }
89-
Write-DeployLog "Loaded HP list from $hpPath"
90-
} catch {
91-
Write-Warning "Failed to load HP device list"
92-
}
93-
}
33+
# Embed supported device lists (no more JSON dependency)
34+
$supportedDellDevices = @(
35+
"Latitude", "OptiPlex", "Precision", "XPS", "Venue", "Vostro"
36+
)
37+
$supportedHPDevices = @(
38+
"EliteBook", "ProBook", "ZBook", "EliteDesk", "ProDesk", "EliteOne", "ProOne", "Z2", "Z4", "Z6", "Z8", "Elite Mini", "Elite Tower", "Elite SFF", "Engage One"
39+
)
9440

9541
# Check if supported
9642
$isSupported = $false

Scripts/Deployment/Remove-Bloat.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,16 @@ try {
213213

214214
$SuccessMsg = "SUCCESS: Removed $Removed apps."
215215
Write-DeployLog $SuccessMsg
216+
217+
218+
Write-Output ""
219+
Write-Output "========================================"
220+
Write-Output " Additional scripts and tweaks..."
221+
Write-Output "========================================"
222+
Write-Output "Windows Spotlight: If you are experiencing issues with Windows Spotlight, ensure that Start menu recommendations are enabled."
223+
Write-Output "If you are still experiencing issues and want to use the Spotlight features for dynamic wallpapers, use the Fix-Spotlight.ps1 script."
224+
Write-Output "This script is available as an optional download: C:\WinDeploy\Download\Fix-Spotlight.ps1"
225+
216226
# Note: Bloatware may be reinstalled with future Windows Updates. For more control, consider using Winutil: https://github.com/ChrisTitusTech/winutil
217227
Write-DeployLog "Note: Bloatware may be reinstalled with future Windows Updates. For more control, consider using Winutil: `e]8;;https://github.com/ChrisTitusTech/winutil`e\https://github.com/ChrisTitusTech/winutil`e]8;;`e\"
218228
exit 0

Scripts/Deployment/Set-HostName.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ Write-Output "Setting hostname."
2323
try {
2424
Write-DeployLog "=== Hostname Setup ==="
2525

26+
2627
$Serial = (Get-CimInstance -ClassName Win32_BIOS).SerialNumber -replace '[^A-Z0-9]', ''
28+
if ([string]::IsNullOrWhiteSpace($Serial) -or $Serial.Length -lt 5) {
29+
Write-DeployLog "No valid serial number found. Unable to set hostname automatically. Please set the hostname manually." -IsError:$true
30+
Write-Output "No serial number found. Please set the computer name manually."
31+
exit 1
32+
}
2733
$LastFive = $Serial.Substring($Serial.Length - 5).ToUpper()
2834
$Hostname = "PC-$LastFive"
2935

0 commit comments

Comments
 (0)