Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ecb272d
Update WinToolkit-template.ps1
Magnetarman May 9, 2026
8ab438a
Create Install-Office.ps1
Magnetarman May 9, 2026
01e998e
Create Repair-Office.ps1
Magnetarman May 9, 2026
eb46989
Create Uninstall-Office.ps1
Magnetarman May 9, 2026
f90353a
Update CI_UpdateWinToolkit_Dev.yml
Magnetarman May 9, 2026
a01611c
Delete OfficeToolkit.ps1
Magnetarman May 9, 2026
969ae67
Update WinToolkit-template.ps1
Magnetarman May 9, 2026
6443c02
Update Uninstall-Office.ps1
Magnetarman May 9, 2026
ae0647a
Update CI_UpdateWinToolkit_Dev.yml
Magnetarman May 9, 2026
2dcf4a8
Update CI_UpdateWinToolkit_Dev.yml
Magnetarman May 9, 2026
5e79e58
Update CI_UpdateWinToolkit_Dev.yml
Magnetarman May 9, 2026
c352549
Update WinToolkit.ps1
Magnetarman May 9, 2026
029c6e7
Update Uninstall-Office.ps1
Magnetarman May 9, 2026
91fe926
Update WinToolkit-template.ps1
Magnetarman May 9, 2026
6eac897
Update WinToolkit.Tests.ps1
Magnetarman May 9, 2026
e88a0bb
Update WinToolkit-template.ps1
Magnetarman May 9, 2026
103c07b
Update Test-CompiledScript.ps1
Magnetarman May 9, 2026
289a4c1
Update WinToolkit-template.ps1
Magnetarman May 9, 2026
dc6a610
Update Test-CompiledScript.ps1
Magnetarman May 9, 2026
6ed0c23
Update WinToolkit-template.ps1
Magnetarman May 9, 2026
ab4259d
Update Test-CompiledScript.ps1
Magnetarman May 9, 2026
6c725cb
✅ Compilato WinToolkit v2.5.4 (Build 42)
Magnetarman May 9, 2026
ef8788d
Update Uninstall-Office.ps1
Magnetarman May 9, 2026
091c736
✅ Compilato WinToolkit v2.5.4 (Build 42)
Magnetarman May 9, 2026
d2cbb26
Update Uninstall-Office.ps1
Magnetarman May 9, 2026
514abd7
✅ Compilato WinToolkit v2.5.4 (Build 42)
Magnetarman May 9, 2026
0fb1a6b
Sync With Dev
Magnetarman May 9, 2026
d4993c3
✅ Compilato WinToolkit vSviluppo in Corso
Magnetarman May 9, 2026
5f2c9a6
Update Install-Office.ps1
Magnetarman May 9, 2026
ff53418
✅ Compilato WinToolkit vSviluppo in Corso
Magnetarman May 9, 2026
8cf65b0
Update Install-Office.ps1
Magnetarman May 9, 2026
787c3e4
Update Debloat
Magnetarman May 9, 2026
9fbd61c
✅ Compilato WinToolkit vSviluppo in Corso
Magnetarman May 9, 2026
cab8c5f
Merge branch 'Dev' into ENHANCEMENT-Upgrade-Office-Debloat-after-install
Magnetarman May 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions WinToolkit-template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,87 @@ function WinUpdateReset {}
function WinReinstallStore {}
function WinBackupDriver {}
function WinDriverInstall {}
# ============================================================================
# OFFICE: Funzioni helper condivise (Install / Repair / Uninstall)
# ============================================================================
function Invoke-OfficeSilentRemoval {
param([Parameter(Mandatory = $true)][string]$Path, [switch]$Recurse)
if (-not (Test-Path $Path)) { return $false }
try {
$params = @{ Path = $Path; Force = $true; ErrorAction = 'SilentlyContinue' }
if ($Recurse) { $params['Recurse'] = $true }
Remove-Item @params *>$null
Clear-ProgressLine
return $true
} catch { return $false }
}

function Stop-OfficeProcesses {
$processes = @('winword', 'excel', 'powerpnt', 'outlook', 'onenote', 'msaccess', 'visio', 'lync')
$closed = 0
Write-StyledMessage -Type 'Info' -Text "📋 Chiusura processi Office."
foreach ($processName in $processes) {
$running = Get-Process -Name $processName -ErrorAction SilentlyContinue
if ($running) {
try { $running | Stop-Process -Force -ErrorAction Stop; $closed++ }
catch { Write-StyledMessage -Type 'Warning' -Text "Impossibile chiudere: $processName." }
}
}
if ($closed -gt 0) { Write-StyledMessage -Type 'Success' -Text "$closed processi Office chiusi." }
}

function Invoke-OfficeDownloadFile([string]$Url, [string]$OutputPath, [string]$Description) {
try {
Write-StyledMessage -Type 'Info' -Text "📥 Download $Description."
$webClient = New-Object System.Net.WebClient
$webClient.DownloadFile($Url, $OutputPath)
$webClient.Dispose()
$success = (Test-Path $OutputPath)
Write-StyledMessage -Type ($success ? 'Success' : 'Error') -Text ($success ? "Download completato: $Description" : "File non trovato dopo download: $Description.")
return $success
}
catch {
Write-StyledMessage -Type 'Error' -Text "Errore download $Description`: $_"
return $false
}
}

function Set-OfficePostConfig {
Write-StyledMessage -Type 'Info' -Text "⚙️ Ottimizzazione profonda di Microsoft Office."

$registrySettings = @(
# Privacy & Telemetria
@{ Path = "HKCU:\SOFTWARE\Policies\Microsoft\office\16.0\common"; Name = "sendtelemetry"; Value = 0 },
@{ Path = "HKLM:\SOFTWARE\Policies\Microsoft\office\16.0\common"; Name = "sendtelemetry"; Value = 0 },
@{ Path = "HKCU:\SOFTWARE\Policies\Microsoft\office\16.0\common\privacy"; Name = "disconnectedstate"; Value = 1 },
@{ Path = "HKCU:\SOFTWARE\Policies\Microsoft\office\16.0\common\privacy"; Name = "usercontentdisabled"; Value = 1 },
@{ Path = "HKCU:\SOFTWARE\Policies\Microsoft\office\16.0\common\privacy"; Name = "downloadcontentdisabled"; Value = 1 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\General"; Name = "ShownOptIn"; Value = 1 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Feedback"; Name = "Enabled"; Value = 0 },
# Performance & UI
@{ Path = "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Graphics"; Name = "DisableAnimations"; Value = 1 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\Graphics"; Name = "DisableHardwareAcceleration"; Value = 1 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\General"; Name = "DisableBootToStartScreen"; Value = 1 },
@{ Path = "HKCU:\SOFTWARE\Microsoft\Office\16.0\Common\LinkedIn"; Name = "ShowLinkedInIntegration"; Value = 0 }
)

foreach ($reg in $registrySettings) {
if (-not (Test-Path $reg.Path)) { $null = New-Item -Path $reg.Path -Force }
Set-ItemProperty -Path $reg.Path -Name $reg.Name -Value $reg.Value -Type 'DWord' -Force
}

$tasksToDisable = @(
"OfficeTelemetryAgentLogon", "OfficeTelemetryAgentFallback",
"OfficeBackgroundTaskHandlerRegistration", "OfficeBackgroundTaskHandlerLogon",
"OfficeFeatureUpdates", "OfficeFeatureUpdatesLogon"
)
foreach ($tName in $tasksToDisable) {
Get-ScheduledTask | Where-Object { $_.TaskName -eq $tName } | Disable-ScheduledTask -ErrorAction SilentlyContinue
}

Write-StyledMessage -Type 'Success' -Text "✅ Office ottimizzato: telemetria, privacy e task pianificati rimossi."
}

function Install-Office {}
function Repair-Office {}
function Uninstall-Office {}
Expand Down
Loading
Loading