I was reading through James' blog post and remembered that I wrote a script some time ago to show or hide desktop icons. The script requires PowerShell 2.0 and shows how you can access WIN32 APIs. #requires -Version 2.0 $signature = @" [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] public static extern bool ShowWindow(IntPtr hWnd,int nCmdShow); "@ $icons = Add-Type -MemberDefinition...
In previous versions of PowerShell if you wanted to discover the static members of a type you had to do: PS > [IO.File] | Get-Member –Static TypeName: System.IO.File Name MemberType ---- ---------- AppendAllText Method AppendText Method Copy Method Create Method CreateText Method (...) In CTP3 there’s no need to do that anymore, start with: PS > [IO.File]:: Now press the TAB key and watch the magic (keep hitting TAB to cycle through all members).
The Windows PowerShell Integrated Scripting Environment (ISE) is a host application that enables you to run commands, write, test and debug scripts in a friendly, syntax-colored, Unicode-compliant environment. What does it have to offer? 1. A command pane for running interactive commands, just as you would in the Windows PowerShell console. Just type a command and press Enter. The output appears in a separate output pane. 2. A script pane to compose, edit, debug, and run functions, and scripts. 3...