[CmdletBinding(DefaultParameterSetName='On')]
param (
[Parameter(Mandatory=$false, ParameterSetName='On')]
[switch]$On,
[Parameter(Mandatory=$false, ParameterSetName='Off')]
[switch]$Off
)
if ($PSCmdlet.ParameterSetName -eq 'On') { $Flag = 1 } else { $Flag = 0 }
$Path = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
Set-ItemProperty -Path $Path -Name "RotatingLockScreenEnabled" -Value $Flag -Force
Set-ItemProperty -Path $Path -Name "RotatingLockScreenOverlayEnabled" -Value $Flag -Force
Set-ItemProperty -Path $Path -Name "SubscribedContent-338387Enabled" -Value $Flag -Force
$SID = (Get-LocalUser -Name $env:USERNAME).SID
$Path = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\$SID"
Set-ItemProperty -Path $Path -Name "RotatingLockScreenEnabled" -Value $Flag -Force
Set-ItemProperty -Path $Path -Name "RotatingLockScreenOverlayEnabled" -Value $Flag -Force