Monday, June 30, 2008

Do you know your aliases?

 

This little PowerShell script you can check how familiar you are with all the built-in aliases in PowerShell V2 CTP2.
For each alias there are 7 cmdlet names to choose from. There are 10 questions, and at the end of the quiz you can review your results and optionally run the quiz again.

You need to have PowerShell V2 CTP2 installed for the script to run.


Good luck :)

 

 

Thursday, June 26, 2008

ActiveXPoSH - PowerShell for VBScript/JScript

 

SAPIEN Technologies has released a new COM component named ActiveXPoSH (included in PrimalScript 2007 script editor). It is a special PowerShell host that allow developers/scripters to run single cmdlets or entire scripts from VBScript/JScript code. The component is free for personal and commercial use.

You can find more details in this document and download it from here.

Saturday, June 21, 2008

Generating TinyURLs from PowerShell

 

TinyURL is a web service that provides short aliases for long URLs. Here's a function to generate URL aliases using TinyURL's API. The returned URL is short and never expires.

 
function New-TinyUrl($url){
    (new-object net.webclient).downloadString("http://tinyurl.com/api-create.php?url=$url") 
}
 
PS > $vug = New-TinyUrl -url http://marcoshaw.blogspot.com/2008/06/windows-powershell-virtual-user-group.html
PS > $vug
PS > http://tinyurl.com/4k9ons

 

Test it in your default browser:

PS > (new-object -com shell.application).open($vug) 

 

-Shay

Friday, June 20, 2008

Windows PowerShell Virtual User Group #6

 

Marco's Windows PowerShell Virtual User Group #6 is going to take place next week:
Tuesday, Jun 24 7:30pm – 10:30pm (Timezone: Eastern Time)

 

Agenda

8:00PM-8:10PM: Introduction
8:10PM-8:40PM: Bruce Payette (Microsoft)
8:40PM-9:10PM: Wassim Fayed (Microsoft)
9:10PM-9:40PM: Hal Rottenberg
9.40PM-9:50PM: Closing

 

Speaker topics

Bruce Payette : PowerShell v2 modules.
Wassim Fayed : PowerShell v2 remoting.
Hal Rottenberg: Managing VMware Infrastructure using PowerShell.

 

To join for video:
https://www.livemeeting.com/cc/winserver_usergroup/join?id=5H2F88&role=attend&pw=8%5E-%5CzqX

To join for audio:
Toll free: +1 (866) 553-8146
Participant code: 5592528585

 

Required login information (via LiveMeeting)

Meeting ID: 5H2F88
Entry Code: 8^-\zqX

 

Mark your calendar :)

Wednesday, June 18, 2008

Portable PowerShell

 

Hallelujah! Get all the details on Karl Prosser [MVP] blog.

Tuesday, June 17, 2008

Webcast: Managing Hyper-V Virtual Machines with WMI and Windows PowerShell

 

Start Date: Wednesday, July 02, 2008 8:00 AM Pacific Time (US & Canada)

 

Event Overview

Before the beta release of Microsoft System Center Virtual Machine Manager 2008, there was only one option for automating management of Hyper-V virtual machines—Windows Management Instrumentation (WMI). In this webcast, you learn how to automate the most common management tasks, how to create a delegation model using Windows Authorization Manager, and where the power of WMI can pick up where Virtual Machine Manager leaves off. In addition, the Hewlett-Packard Windows Server 2008 Academy team shares their experience automating the deployment of 600 virtual machines in less than three hours using WMI and Windows PowerShell.

 
Presenters: Dung Hoang Khac, Principal Consultant, HP, and Aric Bernard, Senior Technology Consultant, HP

 

Register for the event.

Listing enumeration type values (updated)

 

The old function return duplicate names when the enumeration has two names with the same value, for example: 

 

PS >  Get-EnumValues Microsoft.PowerShell.ExecutionPolicy

        Name Value
        ---- -----
Unrestricted     0
RemoteSigned     1
   AllSigned     2
  Restricted     3
  Restricted     3

 

Here is the modified version of the function:

function Get-EnumValues([type]$type){ 
   [enum]::getNames($type) | select @{n="Name";e={$_}},@{n="Value";e={$type::$_.value__}} | ft -auto
}

 

And the results:

PS >  Get-EnumValues Microsoft.PowerShell.ExecutionPolicy

Name         Value
----         -----
Unrestricted     0
RemoteSigned     1
AllSigned        2
Restricted       3
Default          3
 
-Shay