How to switch off display with PowerShell

Define new static type Utilities.Display

# Turn display off by calling WindowsAPI.
 
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST  0xffff
# WM_SYSCOMMAND   0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF       0x0002
 
Add-Type -TypeDefinition '
using System;
using System.Runtime.InteropServices;
 
namespace Utilities {
   public static class Display
   {
      [DllImport("user32.dll", CharSet = CharSet.Auto)]
      private static extern IntPtr SendMessage(
         IntPtr hWnd,
         UInt32 Msg,
         IntPtr wParam,
         IntPtr lParam
      );
 
      public static void PowerOff ()
      {
         SendMessage(
            (IntPtr)0xffff, // HWND_BROADCAST
            0x0112,         // WM_SYSCOMMAND
            (IntPtr)0xf170, // SC_MONITORPOWER
            (IntPtr)0x0002  // POWER_OFF
         );
      }
   }
}
'

Run
[Utilities.Display]::PowerOff()

or via func

function Switch-DisplayOff
{
[Utilities.Display]::PowerOff()
}

©2013 Jakub Jareš

Adobe Acrobat Fix: Error applying transforms. Verify that the specified transform paths are valid (MSI)

Fix for «Ошибка при применении преобразований. Проверьте правильность путей указанных преобразований» while install/update/uninstall adobe acrobat’s msi:
reg export HKLM\SOFTWARE\Classes\Installer\Products\68AB67CA3301FFFF7706000000000060 "%TEMP%\acrobat.reg"
reg add HKLM\SOFTWARE\Classes\Installer\Products\68AB67CA3301FFFF7706000000000060 /v Transforms /t REG_EXPAND_SZ /d "" /f

© Continue reading Adobe Acrobat Fix: Error applying transforms. Verify that the specified transform paths are valid (MSI)

Windows 10 gets a fresh command prompt and lots of hotkeys

Well, from what I can tell looking at the Preview, there’s a LOT of cool Console goodness coming in Windows 10.

Here’s a list of hotkeys in the Windows 10 Technical Preview console. This is just hotkeys! Be sure to explore the Properties dialog as well, resize, word wrapping, and more. Continue reading Windows 10 gets a fresh command prompt and lots of hotkeys