PS D:\> (Get-WmiObject win32_desktop -Filter "Name Like '%$([Environment]::Username)'").ScreenSaverActive
Or:
PS D:\> (Get-ItemProperty -Path 'HKCU:\Control Panel\Desktop').ScreenSaveActive
String of thoughts on science, technology and programming
PS D:\> (Get-WmiObject win32_desktop -Filter "Name Like '%$([Environment]::Username)'").ScreenSaverActive
PS D:\> (Get-ItemProperty -Path 'HKCU:\Control Panel\Desktop').ScreenSaveActive
Comments