这里我要给大家介绍一下WPK,如标题所言,什么是WPK呢? 这里先引用一下WPK官方的一些介绍如下:
The Windows 7 Resource Kit companion CD includes many Windows PowerShell modules that you can use, but you might want to pay special attention to the WPK module. WPK or the "Windows Presentation Foundation (WPF) PowerShell Kit," it enables you to use Windows PowerShell commands to create and display rich user interfaces. With WPK, systems administrators and beginning scripters can make their jobs easier by building user interfaces to simplify complex tasks.
WPK能让你非常简单方便的使用PowerShell实现友好界面,WPK被细分为很多模块,如果你直接导入WPK就可以使用目前851个function,当然也可以分别导入想要使用的模块,列表如下:
|
Module
|
Description
|
|
WPK
|
Create rich user interfaces quick and easily from Windows PowerShell. Think HTA, but easy. Over 600 scripts to help you build quick user interfaces
|
|
TaskScheduler
|
List scheduled tasks, create or delete tasks
|
|
FileSystem
|
Monitor files and folders, check for duplicate files, and check disk space
|
|
IsePack
|
Supercharge your scripting in the Integrated Scripting Environment with over 35 shortcuts
|
|
DotNet
|
Explore loaded types, find commands that can work with a type, and explore how you can use PowerShell, DotNet and COM together.
|
|
PSImageTools
|
Convert, rotate, scale, and crop images and get image metadata
|
|
PSRSS
|
Harness the FeedStore from PowerShell
|
|
PSSystemTools
|
Get Operating System or Hardware Information
|
|
PSUserTools
|
Get the users on a system, check for elevation, and start-processaadministrator
|
|
PSCodeGen
|
Generates PowerShell scripts, C# code, and PInvoke
|
Function Add-CodeGenerationRule ...
Function Add-CropFilter ...
Function Add-EventHandler ...
Function Add-ForeachStatement ...
Function Add-GridColumn ...
Function Add-GridRow ...
Function Add-IfStatement ...
Function Add-InlineHelp ...
Function Add-IseMenu ...
Function Add-OverlayFilter ...
Function Add-Parameter ...
Function Add-PInvoke ...
介绍一下加载项里的功能,比如Show-SyntaxForCurrentCommand功能在你选取你要显示使用语法的cmdlet后点击此功能就会显示该cmdlet的语法使用方法:

当然方法还有很多,这里我使用WPK里的2个function为大家演示一个在GUI上显示一串从小到大显示的label
执行结果如下:

是不是很有趣?如果你对很多function还不是很熟悉的话可以使用get-help查看下,当然给出的帮助内容并非十分详细,或许是因为function实在很多~ 期待WPK的更新改进。
最后PowerShellPack的下载地址为: PowerShellPack
WPK,或Windows Presentation Foundation PowerShell Kit,是一个允许系统管理员和初学者通过构建用户界面简化复杂任务的PowerShell模块。它包含851个功能,能够帮助用户创建丰富的用户界面。本文介绍了如何使用WPK中的特定功能,如Show-SyntaxForCurrentCommand,并展示了一个使用WPK创建的GUI示例,展示了如何在界面上动态显示标签。
107

被折叠的 条评论
为什么被折叠?



