header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left
Random Cmdlets
New-DynamicDistributionGroup
Use the New-DynamicDistributionGroup cmdlet to create a new dynamic distribution group.


Get-ReparsePoint
Gets NTFS reparse point data.


Set-Group
Use the Set-Group cmdlet to modify the settings of an existing Microsoft Windows group.


Set-TransportRule
Use the Set-TransportRule cmdlet to modify an existing transport rule that the Transport Rules agent uses when it processes e-mail messages that pass through a computer that has the Hub Transport server role or the Edge Transport server role installed.


New-UMDialplan
The New-UMDialplan cmdlet creates a new Unified Messaging (UM) dial plan that is used to establish a link between UM IP gateways, UM hunt groups, and Unified Messaging servers to enable communication between UM components.


Set-AddressList
Use the Set-AddressList cmdlet to modify an existing address list.


Enable-UMAutoAttendant
The Enable-UMAutoAttendant cmdlet enables an existing Unified Messaging (UM) auto attendant that is disabled.


Get-FTP
The Get-FTP cmdlet is used to download files and retrieve directory listings from FTP, SFTP, and FTPS servers.


Add-Content
Adds content to the specified item(s).


Convert-Xml
Performs XSLT transforms on the specified XML file or XmlDocument.


  
Latest Scripts from PoshCode.org

egg_timer
A script I submitted for Event 10 of the Scripting games. Displays a simple Windows Form that counts down three minutes. It makes a good example for using Windows forms.

SnapReminder
Remind the users of their snapshots - for use in VMware, see this post for more details: http://www.virtu-al.net/2009/06/22/powercli-snapreminder/

LibrarySqlBackup
Standalone script adapted from SQL Server Powershell Extensions (sqlpsx) http://sqlpsx.codeplex.com. Defines SQL Server backup and restore functions.

Format-TablePlus
This is a wrapper function for Format-Table that adds a @-Width@ parameter, and a @-PadEnd@ parameter (without which it trims the end of every line of output. Set -PadEnd to get the original Format-Table behavior of adding needless whitespace on the end of every line of output.

Colorize Subversion SVN
Colorize STAT, UPDATE and DIFF (without params) commands output for Subversion (svn) and Mercurial (hg). Here's a PowerShell functions that you can use to make those numerous commands you run every day via the PowerShell CLI a little easier to read by adding colors. Autodetect for svn or hg. Update autodetect to work with psdrives that are a UNC path. Also now works with repositorys in the root directory of drive. Added $args to each function so you can do things like sd -r2 -rtip -U0

Get-DirSize
A v2.0 function to recursively get the sizes of all subdirectories under a root path.

vProfiles
vProfiles V1.1 By Alan Renouf http://virtu-al.net, copies vSwitches and PortGroups from one host to another.

Prevent-Screensaver
Simulate user activity to prevent desktop lock or screensaver for specified period of time

TabExpansion for V2CTP3
The most needless, useless and worthless Tabexpansion for powershell.exe(v2.0CTP3) in PoshCode. Update: # Parameter name (and command alias) expansion with Ctrl+E ls -f *.txt -r | ? { $_.LastWriteTime -lt "2009/5" } | Select-String powershell -e OEM<Ctrl+E><tab>. <br> Get-ChildItem -Filter *.txt -Recurse | Where-Object { $_.LastWriteTime -lt "2009/5" } | Select-String powershell -Exclude OEM<tab> Get-ChildItem -Filter *.txt -Recurse | Where-Object { $_.LastWriteTime -lt "2009/5" } | Select-String powershell -Encoding OEM<tab> Get-ChildItem -Filter *.txt -Recurse | Where-Object { $_.LastWriteTime -lt "2009/5" } | Select-String powershell -ErrorAction OEM<tab><tab>...

TabExpansion
The most needless, useless and worthless Tabexpansion for powershell.exe(v1.0) in PoshCode. Please dot souce this script file to use. Update:. # WMI Namespaces expansion for Get-WmiObject gwmi -Namespace <tab>. Get-WmiObject -Namespace root\asp<tab>. # WMI Classes expansion which is corresponding to WMI Namespace (*) gwmi -Namespace ROOT\CIMV2\ms_409 -Class <tab>_<tab>. (*) it needs to remove old $PSHOME\WMIClasses.txt if it exists.
  
 

April 24th, 2009.

Idera, one of our sponsors has joined forces with Don Jones to create some super PowerShell videos that you can find HERE.  Best of all...  They are FREE!

Follow the link above for more information.  Don Jones covers the basics of PowerShell, using PowerShell and Active Directory, using PowerShell and Exchange 2007, using PowerShell and SQL Server 2008, and using PowerShell to manage servers and clients.

The Community has just taken a great leap in getting the word out about how cool PowerShell is!

Marco Shaw - Co-Community Director

Community News
New sponsor: Compellent

PowerShellCommunity.org has an exciting new sponsor: Compellent.  Just added to our sponsors page:

Compellent is a leading provider of enterprise-class network storage solutions...

Microsoft TechDays Defy All Challenges

On April 1st, 2009, Microsoft is putting on a free 24 hour virtual event covering developer-related topics.

There will be 95 live sessions provided via Live Meeting in the following tracks:
*Windows Development and Frameworks
*Windows Mobile Development
*Office...

Microsoft releases IIS7 PowerShell snapin

The full details are HERE.  Microsoft has just released a production version of a IIS snapin for managing IIS7 on Windows Server 2008.  This snapin is independent of any features shipping with Windows Server 2008 R2 (like PowerShell...

New Sharepoint and SQL forums

Due to recent interest in the forum, we've added two new discussion areas:

PowerShell Expert Panel at TechEd EMEA 2008

 We are extremely proud of the the job that Jonathan Medd (of the Get-Scripting Podcast) did at TechEd EMEA 2008 with a panel discussion which was made possible by support from PowerShellCommunity.org. You can find the video on

  
Recent Blog Entries
Jun 17

Written by: Karl Prosser
6/17/2008 9:12 PM

Given the context on the last few posts. I've made a simple helper method in C# that can take a simple powershell hashtable and create a PSCustomObject based on it. Here is an example of how you can call it.

[snapinini.newobjecthelper]::newObjectFast(@{name="karl";age=31;now = [datetime]::Now})

very simple and its at least 6 times faster than the closest other technique in powershell. Most of hte overhead is in creating the hashtable. (otherwise its 90 times faster). The hashtable syntax is very convenient however maybe even its overhead is too much and we deserve a better way.

Here is the C# method. Its pretty basic stuff.

 

public static PSObject newObjectFast( Hashtable noteproperties )
{
PSObject obj = new PSObject();
if (noteproperties != null)
foreach(DictionaryEntry item in noteproperties)
obj.Properties.Add(new PSNoteProperty((string)item.Key,item.Value));
return obj;
}

- Karl

Tags:

Your name:
Title:
Comment:
Add Comment    Cancel  
  

PowerShellCommunity is sponsoring this year's Microsoft Technet Scripting Games, along with the new PoshCode.org. Submit your entry today!

right
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 footer
footer