none
Learning and using PowerShell - docs first RRS feed

  • General discussion

  • I started off with "Select" and naming the individual properties to keep, but forgot about the "ExcludeProperties".

    I don't feel picked on. Switching back and forth between Perl and Powershell, I tend to fall back on techniques from years gone by.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    I was not really targeting you. I ws speaking in general to all who may stumble on this thread. I believe my statements are good for anyone trying to code and can be a reminder to all of us about the better approach to problem solving.

    Read help.
    Refer to the documentation repeatedly.
    Search the web for good examples.
    Lastly ask an informed question with  simple clear example.

    Mostly the issue would be resolved by reading the help.  Unfortunately most new coders don't know how to use help so they ignore the best, first, source of answers.

    The following should be the fist place anyone wishing to use PowerShell should type:

    help help

    Reading this carefully will save hundreds of future hours.

    The first thing any tech (or Windows user) should learn to do is look for the help for anything.  Even notepad has help. 

    Any professional programmer who fails to use help or to read the documentation will likely lose his job fairly quickly.

    Of course asking the guy in the next cubical a simple reminder question like "What is the command for …?" is allowed but anything more detailed should be researched.  Research is what "professional technician" refers to.  Anyone who doesn't understand that is just a "wannabe".


    \_(ツ)_/


    Friday, July 19, 2019 8:42 PM
    Moderator

All replies

  • I started off with "Select" and naming the individual properties to keep, but forgot about the "ExcludeProperties".

    I don't feel picked on. Switching back and forth between Perl and Powershell, I tend to fall back on techniques from years gone by.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    How often have you read the "current" Perl help/documentation?  I repeatedly return to the help in PowerShell to see if I missed some subtle nuance that would make my scripts easier to write.  I have read the release notes for every version of PowerShell many times. Every time I read them I learn something new.  We retain information based on what we currently understand.  Since we are always acquiring new information the next reading will almost always uncover knew information and usage details.

    We are modern humans because we can read.  Before Guttenberg all written knowledge was kept hidden by the priests and the politicians.  The printing press gave anyone who can learn to read the ability to learn new things.  Modern kids do not learn how to read beyond skimming and reading tweets and social posts.  Anything that requires deep comprehension is beyond their reading skills.  School do not teach reading comprehension and haven't for 30 years.

    These reading this who may want to understand reading for comprehension should read this short article.

    Reading for comprehension

    It is easy to learn this but takes a short time to discipline the mind to read correctly for content.  Once this is accomplished the world is open for acquiring new knowledge quickly.


    \_(ツ)_/

    Friday, July 19, 2019 8:57 PM
    Moderator
  • How often have I read the ENTIRE Perl help/documentation? Not often. It's huge. How often do I read the DIFFERENCES in Perl versions? As often as they change Or as often as I change versions. Nobody pushes new stuff on you. It's up to you to update when/if you need to.

    How often do you read  ALL the changes in every module supplied by MS (or 3rd-parties)? The Powershell LANGUAGE is much smaller than the set of modules, yet modules often have dependencies on the version of the language, just as they do in Perl.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Friday, July 19, 2019 9:42 PM
  • How often have I read the ENTIRE Perl help/documentation? Not often. It's huge. How often do I read the DIFFERENCES in Perl versions? As often as they change Or as often as I change versions. Nobody pushes new stuff on you. It's up to you to update when/if you need to.

    How often do you read  ALL the changes in every module supplied by MS (or 3rd-parties)? The Powershell LANGUAGE is much smaller than the set of modules, yet modules often have dependencies on the version of the language, just as they do in Perl.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    I make a point of reading or reviewing the documentation for every module I use however I have a bootstrap. A large number of modules are based on WMI/CIM which I am extremely familiar with. Also many modules have very little documentation outside of the CmdLet help. I nearly always read the help for any CmdLet I use but occasionally read too fast or skip reading only to find out that it was a mistake.

    Primarily anyone wanting to use PS should read the syntax and language usage documentation which is best learned by non-programmers by getting one of the better books on PS.  Unfortunately there are no good free video tutorials.  There are a few very good video tutorials available at a reasonable price.

    By the way … the Perl docs are not that huge. The language is relatively compact. PS was designed with Perl in mind.  Perl and other shell languages were considered when designing PS.  Hopefully the best of all made it into PS.  Ignore the syntax differences.  PS supports nearly all syntax aided devices and does most things in a very consistent way.  Most PS coders know nothing about language structure or about why a language is designed the way it is.  PS does not require this level of technical knowledge but knowing it makes using PS much easier as it helps us to reduce the amount of code required.  For simple scripts almost anything will work assuming the help system is referenced while designing the script.

    Also note that Perl is primarily a reporting language and not a systems language.  PowerShell is primarily a systems automation language - if I can coin that - that is used for maintenance. It is not heavily arched at report generation.  As are most shell languages, Perl is designed for non-programmers. PowerShell is designed with non-programmers in mind but is also very extensible into the programmers world both as a way to build tools and as a way to assist with program design a nd analysis.


    \_(ツ)_/

    Friday, July 19, 2019 10:25 PM
    Moderator
  • I am moving the discussion part of the original topic to a discussion as it is a complete digression from the original question.

    Post to this thread for the discussion.


    \_(ツ)_/

    Friday, July 19, 2019 10:35 PM
    Moderator
  • The thread splitter no longer works correctly so I will have to move each post and merge them after - PAIN!


    \_(ツ)_/

    Friday, July 19, 2019 10:38 PM
    Moderator
  • Just read Windows Powershell in Action by Bruce Payette.  That's the only real documentation.

    Saturday, July 20, 2019 2:23 PM
  • Just read Windows Powershell in Action by Bruce Payette.  That's the only real documentation.


    Excellent book.  All three are excellent.  THe third version is also a good reference.

    \_(ツ)_/

    Saturday, July 20, 2019 4:17 PM
    Moderator