public/Remove/Remove-ISETheme.ps1
function Remove-ISETheme { <# .SYNOPSIS Deletes a PowerShell ISE theme from the registry. .DESCRIPTION The Remove-ISETheme function removes a theme entry from the ISE color theme registry path based on the provided theme name. If the theme exists, it is permanently deleted from the registry. .PARAMETER ThemeName The name of the ISE theme to remove from the registry. .EXAMPLE Remove-ISETheme -ThemeName 'Monokai' Removes the 'Monokai' theme entry from the ISE color theme registry. .NOTES Author: Jeff Pollock GitHub: https://github.com/phriendx/ISEColorTheme.cmdlets Website: https://pxlabs.info #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions','')] [CmdletBinding()] param( [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string]$ThemeName ) process { if ([string]::IsNullOrWhiteSpace($ThemeName)) { Write-Warning "No theme name provided." return } $regPath = 'HKCU:\Software\Microsoft\PowerShell\3\Hosts\PowerShellISE\ColorThemes' if (Get-ItemProperty -Path $regPath -Name $ThemeName -ErrorAction SilentlyContinue) { Remove-ItemProperty -Path $regPath -Name $ThemeName -Force Write-Verbose "Theme '$ThemeName' removed." } else { Write-Warning "Theme '$ThemeName' not found in registry." } } } |