Blog Your Initial PowerShell Experiences

Blog Your Initial PowerShell Experiences

  • Comments 16

Michael Fisher has just started using PowerShell and is blogging his impressions.  You can see them at http://fastdad.wordpress.com/2007/01/05/windows-powershell-10/ .  10,000 thanks Michael!

I can't tell you how valuable we find it when people do this! 

We fully expect that you are going to have to invest a few hours to understand the key PowerShell concepts before you "get it" but if you can tell us about your initial experience/impressions, it helps us tweak things for the people that come after you. We can add some Help, tweak our documentation,  add additional Aliases/Functions etc. 

If you wait a few weeks or even a few days, you'll have developed coping mechanisms and won't remember the early difficulties you had so please blog them while they are still in your head.

In Michael's blog, he mentioned that he didn't find the help intuitive.  That is good to know, it tells me that I have an issue but there isn't enough information to help me address the issue.  When you come across something that isn't working for you, if you could be specific about what the problem was - that is very helpful.  e.g. What did you type?  What did you get vs what did you expect to get?  Alternatively, it is awesome when people tell us what an optimal experience for them would be.  "I'd like to be able to just type xxx and get yyy."  That stuff is pure gold. 

Nothing jazzes up the team more than really understanding how to make PowerShell provide you the best experience possible.  Speak up - we are listening.

Thanks again Michael!

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Leave a Comment
  • Please add 2 and 4 and type the answer here:
  • Post
  • WRT the help system I think the team knee jerked a bit on the initial help system that showed *everything* by default.  I think the current three "views" of help are OK except that I think that the detailed view should be the default view.  Asking for help on a file and not getting any help on parameters is somewhat useless IMO.  OTOH I could see occasionally wanting just a very short "summary" view which is the current default view.  On rare occasions I need the level of detail in the full view.  So I am happy that it is no longer the default view.

  • It boggles the mind that you have detected my blog and have already read and commented on it.

    How did you do that?

    I was going to send you a link to my blog when I had more substance in it. I am currently taking notes on my experience with the help system.

    I will give you one tidbit:

    I would like something like 'apropos' or 'man -k KeyWordOfInterest'.

  • Michael;

    Most blog software tells another server (a "ping server") when you write a blog entry. Then, web sites such as http://www.technorati.com use that ping server to help them detect and index those blogs. So then, you can use those blog search engines to find out when somebody has written something about something you are interested in -- such as PowerShell.

    P.S: As for apropos in PowerShell, check this out: http://www.leeholmes.com/blog/GetHelpMatchSearchHelpAproposInPowerShell.aspx

    Lee

  • Well... Not good, although, after you read this, you might say I-told-you-so.

    Windows DOES need a better shell, for sure.  I've been doing batch programming in DOS since v.3.3, and LOTS of Unix/Linux scripting (Perl and [ba]sh).  I was mildly excited when I heard about Powershell on Paul Thurrott's web site (winsupersite.com).  So I downloaded the intro docs, got a little stoked, and decided to try it.

    My hardware is legacy, definitely.  700Mhz Athlon, 384MB RAM, old drives.  With some tweaking and good video, though, it runs quite well with XP Pro.  It's my main XP test machine in my shop; I figure anything that will run well on IT will run good on a client's system.

    First hurdle:  Upgrade to .NET 2.  I IMMEDIATELY noticed serious performance degredation, particularly in workgroup/domain situations (e.g. browsing remote shares).  And even looking at local drives seemed pokey.  I though, okay, this sucks, but I'll be patient and see if it goes away, and at least give PowerShell a try, right?

    Went ahead and installed PowerShell.  Meanwhile machine is acting funny in other ways, still slow, pausing at strange times.  Started getting "Encountered a problem" pop-ups.  Video artifacts started appearing in Windows Explorer.

    That was enough for me; I removed PowerShell and .NET 2 w/o going further.  Almost all the problems went away after a restart; still getting some video weirdness sometimes, but the machine is 95% back to normal.

    Verdict:  Powershell is a wonderful idea, and I should probably start learning it, but...  I support a LOT of legacy server hardware that is only slightly newer than my test machine, and I need a good shell PRECISELY because I don't want to load a bloated piece of commercial crap to do some very simple maintenance tasks.

    I'll probably keep using ActivePerl in the interim.  .NET 2 still needs a lot of work, and it's no surprise it's not in the automatic update stream for XP.

    - Pat Struthers

  • Howdy Pat!

    Sorry to hear about your troubles.  For most people, .NET 2 is a performance improvement so I'm not sure what was going on with your system.  One possibility is NGEN.  Most things do the NGEN'ing in the background after the install.  Until the NGEN is complete, the performance will suffer.  It is possible that you were seeing the performance of the system suffer due to the background NGENing.  If you try it again, you'll want to take a look at the TASK monitor to see if this is what the issue is.  If it is, suspend judgement until the NGEN completes.

    Again -sorry for your difficulties.

    Cheers!

    Jeffrey Snover [MSFT]

    Windows PowerShell/Aspen Architect

    Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell

    Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

  • My initial impressions...

    I heard about Windows Powershell from one of the TWIT Podcasts, and it sounded ideal to complete one very specific task I had in mind.

    On my old Amiga, I had written a script that used the list command to enumerate the contents of a directory (containing jpgs) and write an html file for the gallery section of my website, and also write (and then run, and then delete) another script file which called netPBM for each jpg in turn and created a thumbnail GIF.  For those of you who haven't used it, 'list' is a sort of dir command, only you can format the output to be any string you like for each file, including variables such as full path, filename without the 3-letter suffix and so on.  It's an incredibly useful command and one I'd love to see on PowerShell (If it's not already there).

    Anyway, I have to say I found it extremely difficult to get into PowerShell.  Without a list of all the commands, and with the documentation being more of an introduction than a reference, I didn't really know where to start.  I found get-childitem, but I couldn't even get it to append text to a file without a line break.  I quickly found that scripts wouldn't run without changing the execution policy, but it took me ages of searching to find out how to do that.  I'd like to end up with a script that starts with a file requester so I can choose the folder of jpgs, but I haven't a clue where to start with that.

    Perhaps my problem is that I have a specific task in mind, rather than just starting at the begining and learning everything.  Maybe I need to buy a book and work through it.  But my initial experience has been rather frustrating and I'm tempted to install an Amiga emulator and just stick with my list command.

  • I would love a pointer to the Amiga List command.

    > Without a list of all the commands, and with the documentation being more of an introduction than a reference, I didn't really know where to start.

    1) Did you type "Help"?  

    2) Would would you have liked to type and what would you like to have seen?

    > I quickly found that scripts wouldn't run without changing the execution policy, but it took me ages of searching to find out how to do that.

    I find that curious because the error message tells you what to type get the help to understand this issue.  How could we have made that more clearer?

    > Perhaps my problem is that I have a specific task in mind, rather than just starting at the begining and learning everything.  

    Sorry to hear that it has been frustrating.  We optimized for "consistent and powerful" over "obvious" so expect that people will have to invest in going through the getting started guide before they "get" the new model.

    Jeffrey Snover [MSFT]

    Windows PowerShell/MMC Architect

    Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell

    Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

  • Hi

    >  I would love a pointer to the Amiga List command.

    OK.  Well, the syntax (from list ?) is:

    list ? DIR/M,P=PAT/K,KEYS/S,DATES/S,NODATES/S,TO/K,SUB/K,SINCE/K,

    UPTO/K,QUICK/S,BLOCK/S,NOHEAD/S,FILES/S,DIRS/S,LFORMAT/K,

    SORT/K,USERS/S,GROUPS/S,ALL/S:

    The most important one is lformat, and I used it like this:

    list pat=#?.(jpg|jpeg) files lformat "<A href='%N'><IMG src='thumbs/%M.gif' alt='Click to view' BORDER='0' HSPACE='0'></A><BR>" >T:tmp

    and:

    list $dirchoice pat=#?.(jpg|jpeg) files lformat "echo *"*$numfiles to go*" >console:*Ndjpeg  %P%N >t:tmp1.ppm *Npnmscale -xysize 150 150 t:tmp1.ppm >t:tmp2.ppm *Nppmquant 256 t:tmp2.ppm >t:tmp1.ppm *Nppmtogif t:tmp1.ppm >%Pthumbs/%M.gif *Neval *$numfiles - 1 to env:numfiles*Necho %N done" >>T:thumb.tmp

    %N means filename, %M is filename minus the suffix, &P is the path.  The second example creates a complete script, which would then be run by the next line in my script.

    There's a full list at http://cd.textfiles.com/zoom2/texts/dosman121/man/list

    > > Without a list of all the commands, and with the documentation being more of an introduction than a reference, I didn't really know where to start.

    > 1) Did you type "Help"?  

    Aah.  OK, fair enough.  I got that I could type help get-childitem or whatever, but, no, I didn't realise just 'help' would give me all the commands.  Pretty dim, I suppose, although I don't think it explicitly says that in the userguide.

    > 2) Would would you have liked to type and what would you like to have seen?

    Well, now I know that, I can start to find things.  I guess I was expecting all of the help info as an annex to the userguide.

    > > I quickly found that scripts wouldn't run without changing the execution policy, but it took me ages of searching to find out how to do that.

    > I find that curious because the error message tells you what to type get the help to understand this issue.  How could we have made that more clearer?

    OK, fair enough -  that one is an unfounded critisism.  I guess while searching for "script" on your blog I read a comment about how the default setting was to not run scripts unless the policy had been changed and I then searched in the userguide and then on the internet for a way to do this, rather than just trying.  I also didn't spend enough time in the getting started guide, because it is in there.  I've had another look and the info is quite clear.

    > Sorry to hear that it has been frustrating.  We optimized for "consistent and powerful" over "obvious" so expect that people will have to invest in going through the getting started guide before they "get" the new model.

    Yes, that's totally understandable.  

    Is there any reason why the window has a maximum width?  I've got a widescreen monitor and Powershell only uses half of it.

    Also, Copy and paste would be useful for transferring lines between a script file and the console.

    Anyway, I've gone back and persevered for the last few hours and come up with

    get-childitem *.jpg | sort-object name | foreach { $a = '<A HREF="' + $_.name + '"><IMG SRC="thumbs/' + $_.name.remove($_.name.get_length() - 4,4) + '.gif" alt="Click to view" BORDER="0" HSPACE="0"></A><BR>' ; $a >> contents.txt }

    Which seems to be a start.  I guess I'll subscribe to the newsgroup and take my questions there.  Thanks for getting back with that info.

    Nick

  • Hi,

    I have to say that on the whole, I really like PowerShell. I've been using it for a couple of months now though, and the one thing that I *still* have problems with is arrays. There seems to be a bit of an inconsistency. Let me show you what I mean:

    PS> $h = @{}

    PS> $h | gm

      TypeName: System.Collections.Hashtable

    Name    MemberType   Definition

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

    Add     Method       System.Void Add(...

    Clear   Method       System.Void Clear()

    Clone   Method       System.Object Clone()

    ...

    But:

    PS> $a = @()

    PS> $a | gm

    Get-Member : No object has been specified to get-member.

    At line:1 char:7

    + $a | gm <<<<

    So how on Earth do I create an empty array if that actually *is* what I want to do? Another problem I have with arrays is that if I want to create an array that has one element which is an array, this is how it looks in my brain:

    PS> $a = ((1,2))

    ...but in PowerShell's brain, this is:

    PS> $a = (,(1,2))

    Yuck!

    The other things I would like to see in PowerShell are built-in support for secure, firewall-friendly remoting and parallelism in the pipeline. By parallelism I mean that it would be cool if each part of a pipeline could be running simultaneously (I don't care if it's done with threads or processes!) in order to try to increase the throughput a bit.

    I hope my comments are useful to you. My thanks go to all the team for creating PowerShell.

    Cheers,

    Damian.

  • I don't know if anyone will be notified of this comment, but the one thing that command-line based help *needs* is examples.

    If I call get-help on something, I want to see examples of the most common usages. In linux for example, I always forget how to create a tar. I have to look through the man pages for all the various options, when all I really want is to see:

    "Create a tar:

    tar cvf output.tar my_directory"

    Even if it's buried in a "get-help -Examples" I'd be happy.

  • Mike: We agree. Does this help?

    PS >Get-Help Select-String -Examples

    Which is explained by

    PS >Get-Help Get-Help

    :)

    Lee

  • I just started trying Powershell and while it looks like it has some neat functionality I really  got turned off by it not being as simple as running a VBscript or Batch file or a ksh file.

    That alone has soured me on it. I may get over this initial reaction but anyone who has scripted in Unix will be disappointed. This should automatically out of the box have the file associations set up so that scripts will run like batch or ksh scripts. The primary audience that will want to use this are developers who will be working on secure servers and they will expect the same ease of use that they get with other script languages.

    We were going to consider using this for coding    our ETL jobs but this really just reinforces my feelings that Windows is not a good choice for ETL processing.

  • I am personally not a fan of powershell. yes there can be some new advantages for scripting and what not. However I chose not to be a programmer for a reason. This also the reason I have not done the Linux route. I am working on an exchange 2007 problem with permissions, what a nightmare!! I feel like a programmer from India just cutting and pasting code to get things to work. Go ahead and improve the shell, that great, just give us the tools that can do the same thing. That's what made windows so easy to administer.

  • Looked at power shell to execute a script for a specific task (to return XML from a SQL stored procedure because BCP stuffs up the formatting).. found a script, tried to execute it, went looking for help only to find that the explanation on how to even execute a simple script takes 5-6 pages worth of  "Tips and Tricks" to get it working.

    Off I go back to VBScript I don't have time to waste on something that needs me to jump through flaming hoops of poo just to get it to execute a "hello world" script. What a stupid idea and a complete waste of time, did you outsource this to the same team in India that came up with "the ribbon" in MS Office.

    It appears I am not alone in my frustration allanpeda.wordpress.com/.../why-windows-powershell-sucks

  • Were you guys on drugs when you put the green light on powershell?

    Its the most convoluted command line interface I have ever used in my life... and thats sad because I feel right on home on a nortel pbx.

    This is not a command line interface- its a convoluted scripting language designed by a team of bureaucrats at MS

    Windows still has a crappy command line interface, its still a problem.... and no, powershell is not the solution.  

Page 1 of 2 (16 items) 12