Oct 14, 2013 at 4:52 AM
Edited Oct 14, 2013 at 6:25 PM
If you want something really minimal, you need to use the pure-script WASP 2 module.
The module is still in beta, and the PoshCode installer is still in beta (and may not work on PS2 at all), but you can try this command:
If you get timeouts (command not found) trying to execute off the WebDAV share, you can try the steps in
or you can download the Install.ps1 scripts and the
(which is a windows Package file -- you can actually just rename it to zip and then unzip and find the "WASP" module folder and
install it manually instead of using the Install.ps1)
Anyway, I haven't uploaded the source to WASP 2 here because I'm still not happy with the command surface, it includes stuff like the horribly un-powershelly:
Invoke-Window.SetWindowVisualState -State Minimized
But you can probably work with it anyway, and presumably you'll be able to figure out how to min/max/resize/focus just by looking at the commands that are exported from the module.
You cannot send "Win" with the Send-Keys or Send-UIKeys, they're based on
, but the rest of it is documented there. Having said that, I'd argue there isn't anything you should need to automate with the Win key that you can't automate some other way ;-)
I've been meaning to migrate the Send-UIKeys to use
but haven't gotten around to it. That one can definitely send the logo key, etc.
P.S.: There are
existing "script compilers" for PowerShell (including as part of third-party editors/shells), including at least one which "encrypts" the scripts so it's harder to extract with reflection.
They basically just embed the script as a resource, and then use PowerShell's APIs to execute (so all you need is a modern Windows box that has PowerShell preinstalled), and you can double-click the exe. Frankly, I believe that's shortsighted, but never mind,
as far as I know, they don't deal with compiling third-party binary modules into your resulting .exe and importing them as modules into the PowerShell runspace, but
all of that is certainly possible
with the PowerShell API, although I can't imagine a non-nefarious reason that would make doing so worthwhile over using an installer like the PoshCode module or, within a corporation, a simple UNC path where you store