Welcome to MSDN Blogs Sign in | Join | Help

Introducing the Windows 7 Resource Kit PowerShell Pack

Since I work on the PowerShell team, I’ve been lucky enough to get a couple of years jump start on producing PowerShell V2 scripts and modules.  With every new script I write in V2 I get more and more amazed by the possibilities in PowerShell.  I’ve discovered how to do many cool things that, as some of my colleagues outside of the PowerShell team have put it, have showed them the Power of PowerShell.

At each CTP of PowerShell, I’ve tried to share this power of PowerShell here on this blog.  Thanks to Mitch Tulloch (the main author of the Windows 7 Resource Kit) and Ed Wilson (the Scripting Guy), I was able to collect some of my V2 modules for the companion CD of the resource kit.  This collection of scripts became know as the Windows 7 Resource Kit PowerShell Pack.

Today, the Windows 7 Resource Kit should be available in stores, and the PowerShell Pack is available for download on code gallery.

The PowerShell Pack contains over 800 scripts in 10 different modules.  Here’s a brief overview:

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.  To get started learning how to write rich WPF UIs in script, check out Writing User Interfaces with WPK.

IsePack
Supercharge your scripting in the Integrated Scripting Environment with over 35 shortcuts.

TaskScheduler
List scheduled tasks, create or delete tasks

FileSystem
Monitor files and folders, check for duplicate files, and check disk space

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 P/Invoke

I’ll be posting a lot more about these modules in the next weeks, both here and on Channel9, but you can start exploring the modules now by checking out the PowerShellPack on code gallery.  I will also be tweeting some cool tidbits about the PowerShell Pack under the tags: #PowerShellPack, #WPK and #IsePack

I’ll also be on Hal Rotenberg’s PowerScripting Podcast tonight talking about the PowerShell Pack.

Hope this helps,

James Brundage [MSFT]

Quick Note: The MSI was updated at ~ 4:30pm on day of release. If you downloaded it before this time, please download the MSI again.

Published Thursday, October 15, 2009 9:50 PM by PowerShellTeam
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

That's great!

I am having one issue when running Import-Module PowerShellPack

You cannot call a method on a null-valued expression.

At C:\Users\username\Documents\WindowsPowerShell\Modules\IsePack\Add-IseMenu.ps1:90 char:47

+                     $m = $iseMenu.Submenus.Add <<<< ($itemName, $scriptBlock, $_.ShortcutKey)

   + CategoryInfo          : InvalidOperation: (Add:String) [], RuntimeException

   + FullyQualifiedErrorId : InvokeMethodOnNull

I am running Win 7 Pro 64bit. Any Ideas?

Thursday, October 15, 2009 3:39 PM by Brian Scott

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

Great stuff! Looking forward to getting into it.

Thursday, October 15, 2009 5:11 PM by Doug

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

Brian.  The issue you indicated was a slight bug in the produced MSI.  This was the update I uploaded @ ~4:30 PM PST.  It should be working fine now.

James

Thursday, October 15, 2009 5:51 PM by PowerShellTeam

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

PS C:\> $h = Get-Help *

PS C:\> $h.Count

471

PS C:\> Import-Module wpk

PS C:\> $hh = Get-Help *

PS C:\> $hh.Count

471

PS C:\> $hl = Get-Help New-Label

PS C:\> $hl.Synopsis

Creates a new System.Windows.Controls.Label

- Why 'get-help *' is not work for WPK module?

Thursday, October 15, 2009 6:27 PM by Alex

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

I re-downloaded the msi, the amount of errors is greatly reduced but I did receive:

Add-Type : c:\Users\JKav\AppData\Local\Temp\neohef_v.0.cs(4) : { expected

c:\Users\JKav\AppData\Local\Temp\neohef_v.0.cs(3) :

c:\Users\JKav\AppData\Local\Temp\neohef_v.0.cs(4) : >>> namespace SystemMetrics0.609978667278764

c:\Users\JKav\AppData\Local\Temp\neohef_v.0.cs(5) : {

At C:\Users\JKav\Documents\WindowsPowerShell\Modules\PSSystemTools\PSSystemTools.psm1:2 char:33

+ $script:systemMetrics = Add-Type <<<<  -Name SystemMetrics `

   + CategoryInfo          : InvalidData: (c:\Users\JKav\A...514: { expected:CompilerError) [Add-Type], Exception

   + FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : Cannot add type. There were compilation errors.

At C:\Users\JKav\Documents\WindowsPowerShell\Modules\PSSystemTools\PSSystemTools.psm1:2 char:33

+ $script:systemMetrics = Add-Type <<<<  -Name SystemMetrics `

   + CategoryInfo          : InvalidData: (:) [Add-Type], InvalidOperationException

   + FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand

Thursday, October 15, 2009 7:07 PM by JKav

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

I had the same "{ expected..." error when importing pssystemtools. In my case PSCX 1.2 is the culprit. It also has a get-random cmdlet. The Powershell get-random generates an Int32 while the PSCX version produces a double.

As a workaround I changed this line in PSSystemTools.psm1

$script:RandomNamespace = "SystemMetrics$(Get-Random)"

to

$script:RandomNamespace = "SystemMetrics$(Microsoft.PowerShell.Utility\Get-Random)"

PSCX should start using prefixes :-)

Friday, October 16, 2009 1:25 AM by Martin

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

Thanks, I re-downloaded the MSI and it worked fine.

Friday, October 16, 2009 9:15 AM by Brian Scott

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

James - this is great!  I was just about to start using Powerboots but I guess this will be the way to go for now...

I'm struggling with some XAML control elements that don't appear to be present or don't translate on the New-* cmdlets, specifically how do I use "Width=Auto" and "LastChildFill=True" (ie. the XAML would  be "<DockPanel Width="Auto" Height="Auto" LastChildFill="True">")?

New-DockPanel seems to choke on "-Width 'Auto'" or on "-LastChildFill 'True'".

Thanks - this is going to be fun!

Chris

Friday, October 16, 2009 10:53 AM by Chris Warwick

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

Thank you James,

for IsePack.

There are a lot of fine functions in IsePack.

And I think you give a goog example for coding style of the individual functions.

That will help me a lot rewriting some of the functions in Ise-Cream http://www.codeplex.com/psisecream.

It is important to find easy ways, so that anyone can merge Ise-Extensions from different sources into his profile.

In the long run, we need a standard way helping to individually configure the add-ons menu, especialy the hot-keys.

Bernd Kriszio

[twitter @bernd_k]

Sunday, October 18, 2009 6:01 AM by Bernd Kriszio

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

This is obviously intended for Windows 7, but will it work in previous versions of Windows with Powershell v2 installed?

Monday, October 19, 2009 3:28 PM by Tim

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

There seems to be a bug (typo really) in the get-OSVersion cmdlet, that causes Windows Server 2003 to be reported incorrectly.  The definition of the cmdlet shows this logic:

-----------------------------------------

$os = Get-WmiObject Win32_OperatingSystem -computerName $computer -Impersonation Impersonate -Authentication PacketPriv

acy

   if ($detailed) { return $os }

   Switch -regex ($os.Version)

   {

       "5.1.2600" { "Windows XP" }

       "5.1.3790" { "Windows Server 2003" }

       "6.0.6001" {

           if ($os.ProductType -eq 1) {

               "Windows Vista"

           } else {

               "Windows Server 2008"

           }

       }

       "6.1."    { "Windows 7" }

       DEFAULT { Throw "Version not listed" }

   }

------------------------------------------

However, "Windows Server 2003" should be matched to "5.2.3790", not "5.1.3790".

Thanks to the whole team - these are wonderful.

Wednesday, October 21, 2009 7:55 AM by Steve-Balt

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

Random Crashes.

Is anyone else trying to use WPK?  I've been developing a UI front end for an application and it's really easy to use.  Excellent.

BUT.  No matter how simple the WPF, it seems once I've imported the WPK module that after some time (between 15-45mins) calling a WPK New-* cmdlet will crash the PowerShell host (whether it's the standard console host, ISE or PowerShell Plus).

This is VERY frustrating and unless fixed it means my application will never be useable.  Can anyone else repro?  I've got a very standard (recently installed) Win 7 Ultimate release version, 64-bit.  Have the same issue on my laptop - Win 7 release version 32-bit.

Application eventlog error 1000 (this one's for ISE but I have LOTS of others...)

Faulting application name: PowerShell_ISE.exe, version: 6.1.7600.16385, time stamp: 0x4a5ba920

Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0

Exception code: 0xc000041d

Fault offset: 0x000000000000aa7d

Faulting process id: 0x1a28

Faulting application start time: 0x01ca55618f97f5f8

Faulting application path: C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe

Faulting module path: C:\Windows\system32\KERNELBASE.dll

Report Id: 57a3555f-c168-11de-88c0-0015589b6a1b

Followed by event 1001:

Fault bucket , type 0

Event Name: APPCRASH

Response: Not available

Cab Id: 0

Problem signature:

P1: PowerShell_ISE.exe

P2: 6.1.7600.16385

P3: 4a5ba920

P4: KERNELBASE.dll

P5: 6.1.7600.16385

P6: 4a5bdfe0

P7: c000041d

P8: 000000000000aa7d

P9:

P10:

Attached files:

C:\Users\chris\AppData\Local\Temp\WERA65A.tmp.WERInternalMetadata.xml

These files may be available here:

C:\Users\chris\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_PowerShell_ISE.e_32816bd647a0eca648546f5eac301673d195cb3_0915ac27

Analysis symbol:

Rechecking for solution: 0

Report Id: 57a3555f-c168-11de-88c0-0015589b6a1b

Report Status: 17

Thanks all.

Chris

Sunday, October 25, 2009 6:31 AM by Chris Warwick

# re: Introducing the Windows 7 Resource Kit PowerShell Pack

Will this pack work on Vista and XP? Or the new scripts are applicable only to Windows 7?

Saturday, October 31, 2009 12:17 AM by powershell

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker