(How) can I pipe this (without using the variables)?
$regPath="HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
$regProp="AppsUseLightTheme";
$toggledDarkMode = (Get-ItemProperty $regPath $regProp).$regProp -bxor 1
Set-ItemProperty $regPath $regProp $toggledDarkMode;
Something like:
Get-ItemProperty ... | Set-ItemProperty -value ($_ -bxor 1) ...