First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
« Onkyo TX-SR674 HDMI Upconverting Receive... | Main | Is there a good reason to mark a class p... »

Jason Scheuerman from my company has created a PowerShell Cmdlet Visual Studio 2005 Template so you can create PowerShell Cmdlets using File|Add New Item.

In the screenshot at right, I've select File|Add New Item and entered get-thing.cs as the name of my new Cmdlet.

If you want to use this Item Template, drop this zip file into your C:\Documents and Settings\<YourUserNameHere>\My Documents\Visual Studio 2005\Templates\ItemTemplates.

Don't unzip it, just put the ZIP itself in that folder.

You can learn more about creating Cmdlets (they're different from PowerShell Scripts (PS1 files) in that they can integrate more tightly with the pipeline and they can use parameter binding) at MSDN.

There's more about the difference between Cmdlets and scripts in my interview with Jeffrey Snover at Hanselminutes.com.

Tracked by:
"New and Notable 117" (Sam Gentile) [Trackback]


Friday, October 20, 2006 7:10:32 PM (Pacific Standard Time, UTC-08:00)
Scott,

Would you export your VS setting and make them available for download?

Thanks,
Stephen
Stephen
Monday, October 23, 2006 4:09:01 AM (Pacific Standard Time, UTC-08:00)
Scott: Yes, any chance that you can share your Font and Colors Visual Studio settings? :)
Monday, October 23, 2006 5:02:13 AM (Pacific Standard Time, UTC-08:00)
@ Stepehen, Diego:
The color scheme that Scott uses looks like, Brad Wilson's Dark Visual Studio.
http://www.agileprogrammer.com/dotnetguy/archive/2006/09/07/19030.aspx
I use at home and rocks :)
Monday, October 23, 2006 9:50:12 AM (Pacific Standard Time, UTC-08:00)
http://www.hanselman.com/blog/ChangingYourColorsInVisualStudioNETBlackVersusWhite.aspx
Monday, October 23, 2006 10:15:52 AM (Pacific Standard Time, UTC-08:00)
Beh, It was a snap to create a new cmdlet ;)

By the way, when I create a new Cmdlet from the template,
the resion inside the class is collapsed.

Is there a way to prevent the source code folding so that right after creating a new class, one would not have to unfold the source?

Thank you in advance.
Sung Kim
Monday, October 23, 2006 5:06:03 PM (Pacific Standard Time, UTC-08:00)
Thanks Scott!
Diego Barros
Tuesday, October 24, 2006 10:15:47 AM (Pacific Standard Time, UTC-08:00)
Sung: Solution is pretty simple.

1) Open the zip file
2) Extract the .cs template file in there
3) Remove the #region statement lines
4) Put the .cs file back in the zip
Comments are closed.

Contact

Sponsors

Hosting By

On this page...

Tags

Calendar

<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

Archives

Google Ads