PowerShell Team

Automating the world one-liner at a time…

Latest posts

Dec 31, 2008
Post comments count 0
Post likes count 0

PowerShell_ISE Scripting: ConvertTo-Comment

PowerShell Team

Let me combine a couple of things.  1) When I posted my PowerShell_ISE profile, I included a function Goto-Line that is now builtin to the ISE so I reposted the blog with this function commented out. I commented it out instead of deleting it because I wanted to provide an example of how to do it. 2) Vivek Sharma left a comment asked about programmatically controlling indentation so I gave a couple of pointers to the objects required to program the editor. So let’s take those 2 and put them together and write a function which will convert the selected text into a PowerShell comment (using another CTP3 fea...

Dec 31, 2008
Post comments count 0
Post likes count 0

I’m Changing My Name To Sznarwakowski

PowerShell Team

I was just reading a blog post where they were showing al the SCVVM commands in a list.  I was going to refer them to my blog which shows how the display that list of commands in a really nice format.  I have no idea where that blog post is so I decided to search for my name and scvvm.  Here is what I got:   I think I'm going back to the old family name:  Sznarwakowski. Sure I'll spend the rest of my life telling people how to pronounce and spell it but at least I won't be confused with a serial killer/sex cannibal or an Enron felon. Oh wait! It gets better (worse?).  I didn't rem...

Dec 30, 2008
Post comments count 0
Post likes count 0

My Powershell_ISE Profile Part 2

PowerShell Team

I messed up. First let me remind you that what you have are CTP bits and that CTP bits are subject to change.  It turns out that we are tweaking the PowerShell_ISE object model and that the profile I posted does not work with CTP3.  I’m sorry for that screw up. You can use the amazing PowerShell_ISE to fix this problem.  All you need to do is a search and replace of: CurrentOpenedRunspace.ToolsMenu with CustomMenu Also GoTo-Line is now built into the editor so you should comment that out.  I’ll keep it in the script (commented out) so that you can see how it works. I’ve attached the...

Dec 29, 2008
Post comments count 0
Post likes count 0

My PowerShell_ISE Profile

PowerShell Team

[UDPATE - the original post had a script which did not work with CTP3 so I've replaced it with the correct version.  Apologizes for the screw up. I've updated the attached file as well. - jps]  I thought I would share my PowerShell_ISE profile with you.  I haven't done anything to clean this up or document it which I should do before sharing but I figured that it would be better to get some good examples out there and then I can clean it up later.   # I'm doing a lot of work with Modules these days so I added a drive to make it easy to # get to. New-PsDrive -Name Mod -PSProvider...

Dec 29, 2008
Post comments count 0
Post likes count 0

Download Windows PowerShell

PowerShell Team

  Available Releases The following releases of Microsoft Windows PowerShell are available for download: Windows Management Framework 3.0 <<-- Latest RTM Release!    Windows Management Framework    Windows PowerShell 2.0 CTP3 Windows PowerShell 1.0 RTM Related Downloads Deprecated Releases The following releases are no longer available online: Windows Management Framework RC - PowerShell+WinRM+BITS Windows PowerShell 2.0 CTP2 Windows PowerShell 2.0 CTP1    

Dec 24, 2008
Post comments count 0
Post likes count 0

Write-CommandBlogPost

Radhika Tadinada

.CmdletName { font-size:large } .CmdletSynopsis { font-size:medium } .CmdletDescription { font-size:medium } .CmdletParameters { font-size:medium } th { font-size: medium; font-style: italic } table { border: 1 } On the PowerShell team, we're big believers in the Virtuous Cycle. As you learn PowerShell more and more, things should get easier and easier to do. Inline help is a great example of the virtuous cycle, because it allows you to write scripts in such a way that they're easy to learn about the same way you learn about most things i...

Dec 24, 2008
Post comments count 0
Post likes count 0

Experiment with PowerShell V1 Without Installing It

PowerShell Team

If you are reading this, you probably already use PowerShell but you might know someone that has resisted installing it and trying it out.  Thomas Lee posted a blog HERE with a pointer to a Virtual PowerShell lab on TechNet. This allows you to Terminal Serve into a hosted virtual machine and kick the tires. In other words you get to run PowerShell without installing it. Once they are done – they can install it.  :-) I didn’t know anything about this but we should try to get them to do this with V2 CTP3 – that would be cool. Thanks for the pointer Thomas! Jeffrey Snover [MSFT] Windows Management Part...

Dec 24, 2008
Post comments count 0
Post likes count 0

PowerShell V2 – External MAML Help

PowerShell Team

As you’ve probably picked up by now – Advanced Functions are super important. We've been showing a bunch of scripts that have embedded help using comments and dot-tags. Let me take a second and drill into this. We believe that PS will be used in a wide range of; scenarios: simple one liners; personal ad hoc scripts; scripts you share with your friends; scripts you share with the community; scripts you in your commercial product. It is our goal to have a single mechanism with progressively richer and richer optional features to support this entire range of scenarios. We’ve been showing you the Community H...

Dec 24, 2008
Post comments count 0
Post likes count 0

PowerShell v2 Pipelining in 73 (make that 53) Characters

PowerShell Team

I started using Twitter and saw a request from Thomas Lee for help about pipelining in CTP3.  The thing about Twitter is that the messages have to be tiny so I wasn’t sure I could answer using it.  It turns out I can solve this problem AND give a usage example in 73 characters.  Here goes: PS> function t{param([Parameter(ValueFromPipeline=1)]$t);process{$t}};1..10|t 1 2 3 4 5 6 7 8 9 10 Now if you put it into a file (which is actually what Thomas asked for), then it is only 53 characters: PS> cat t.ps1 param([Parameter(ValueFromPipeline=1)]$t);process{$t} PS> cat t.ps1 |Measure -Charact...