none
New to PS but trying RRS feed

  • General discussion

  • Hello Scripting Guy,

    Let me start off by saying I have never seen PS before.  I am a complete NOOB...I am a Systems Engineer so I use AD a lot and I had a co-worker that could do things that took him 10 minutes and I would had taken me hours.  I want so badly to get knowledgeable on how to use it.  I know it would streamline a lot of my tasks.

    I am pretty simple you type in a cmdlet and it does what you say but I type this in and I am not sure why -module is there?

    Get-Command -Verb get -Noun *ip* -Module NetTcpIp

    I am not sure why -module works.  I am reading what it means but -module doesn't make sense to me?

    it appears that the  -Module NetTcpIp essentially says show only those that have NetTCPIP

    when I type Get-Command -Verb get -Noun *ip*

    I show belowSource is where I find NetTCPIP

    it would make sense to me if it were wrote like this?

    Get-Command -Verb get -Noun *ip* -source NetTCPIP

    of course it didn't work.

    when I see Module I think Get-Module and I am not sure what the -module Operator does?

    I am following along with 2 books you have released Powershell 3.0 and Powershell Step by Step.  I switch between the two to get more information as I go along. 

    I am sorry if this is something simple but I just need an explanation of why -Module works, and what are operators?

    Lastly is there another way to type this that is easier or makes more sense?

    • Changed type Bill_Stewart Tuesday, December 11, 2018 9:24 PM
    • Moved by Bill_Stewart Tuesday, December 11, 2018 9:25 PM This is not "teach me basics step-by-step" forum
    Wednesday, July 25, 2018 8:39 PM

All replies

  • Are you asking what the -Module parameter to Get-Command does?

    The help states:

    Specifies an array of modules. This cmdlet [i.e., the Get-Command cmdlet] gets the commands that came from the specified modules or snap-ins.
    Not sure what's unclear about that?

    -- Bill Stewart [Bill_Stewart]

    Wednesday, July 25, 2018 9:00 PM
  • Before making yourself crazy start with this video.  It will straighten all of this out.

    Learn PowerShell  

    It is a good and comprehensive dive into PowerShell done by two MS masters of PS.  Jeffrey Snover is the Chief Architect of PowerShell.  You cannot get any closer to the source.

    The tutorial takes about 5 hours and should be done slowly one segment at a time.  Segments are mostly less than an hour.


    \_(ツ)_/



    • Edited by jrv Wednesday, July 25, 2018 9:02 PM
    Wednesday, July 25, 2018 9:00 PM
  • As a Sytsems Engineer I understand in granting File permissions I need to understand Parent to Child relationship and use List, Read Only. and Full concept to ensure the user can get into files that they are supposed to and nothing more. but explaining that to a user I need to remember that the user does not have the knowledge that I have so I need to explain it in a way that they will understand.   Below is what the book shows and the next one is what output I got.  I want you to understand where I drew my conclusion.  I know the command came from PS 3.0  book and I know it is a bit old but the concept should be the same.  When I read it was just put in there with no explanation of what it does.  I think the book assumes I have some programming background and I have none.  I want to show you my reasoning for not understanding -module.

    Get-Command (look for a cmdlet)

    -verb Get (it begins with Get-)

    -noun *ip* (the other side of - has IP in it)

    -module (look under the ModuleName?)

    TCPIP (show only TCPIP)


    so in my mind it should not be Modulename but Source because of what column it is in when I typed it.

    I see your explanation of 

    "Specifies an array of modules. This cmdlet [i.e., the Get-Command cmdlet] gets the commands that came from the specified modules or snap-ins."

    but can you simplify the explanation.  I have no knowledge of programming so the concept of Array and Module is foreign to me.

    In Get-Help there is Get-Module but the explanation looks to be different than -module?

    To try to help you understand my thinking let me show you how I am understanding certain Cmdlets

    Get-Childitem = Dir

    Get-Command = look up a command I need to use

    -recurse = show sub directories

    Get-process = Task Manager

    Get-Services = Windows Services

    now I know that as I get better, I will need to get more granular with my definitions but for me it is easier to break it down to make it simple so that....

    I need to create 5 random numbers 1-100 the command all makes sense

    Get-randominputobject(1..100) –count 5

    a person just starting out will understand what I am doing?

    I really appreciate that you took the time to help me.

    Book 3.0


    My output


    Thursday, July 26, 2018 2:16 PM
  • Hello Jrv

    That was the first one I tried and I was following until he gave an example using commands I had never seen and he was talking like "if you type this in you can do this, I was thinking to myself.  I will never get this...weeks later I was trying to figure out an issue I had with Active Directory and found the only solution was to use PS.  so I bought 2 books both from Author Ed Wilson

    1. Powershell 3.0 First Steps

    2. Powershell Step by Step, third edition

    I am switching between the two so that I have a more full grasp of the concepts.  I know that 3.0 does not have all the same commands but I am able to figure out the same command in 5.1.

    Like the video the command just popped up and I searched to figure out what -module did.

    as I have heard a lot lately "With each new update there are faster, easier, and better ways to do things"

    I always say the difference between me and a novice is that I know what to ask Google to get my answer. In this case I am the novice. 



    Thursday, July 26, 2018 2:29 PM
  • It's actually not that hard to understand. With Get-Command you're asking Powershell to list commands. With every parameter you specify more you limit the list of commands to a certain criteria. With -Verb get you only get commands starting with get. with -Noun *ip* you limit the list further more to only show commands starting with get AND containing the string "ip" in it. If you like to limit the list further more to only show cmdlets from a certain module you use the parameter -Module and specify whatever module you are looking for.

    Best regards,

    (79,108,97,102|%{[char]$_})-join''



    • Edited by BOfH-666 Thursday, July 26, 2018 2:33 PM
    Thursday, July 26, 2018 2:32 PM
  • Without taking the video tutorial or getting a book on PowerShell you will continue to spin your wheels trying to guess out basic concepts.  If you are an engineer with a degree then you know that all science and engineering is empirical.  You must know the basics before moving on.

    A civil engineer must first learn materials science before learning how to design a roadway, bridge or building.  THe basics cannot be guessed at.

    In programming you must fist learn the basics before trying to understand the complex implementation of a programming "system". PowerShell is not a script or script language.  It is a scripting system designed for automation of management tasks.

    The video tutorial will give you the basics and a complete overview of PowerShell and how it works and why.  You will not learn PowerShell by asking 100 questions in a forum.


    \_(ツ)_/

    Thursday, July 26, 2018 2:55 PM
  • Agree with jrv. If you are not familiar with basic concepts such as an array, then you need to go back to basics and learn them. Otherwise you will be very frustrated. You can't get the information piecemeal. Agree with jrv's civil engineering analogy: It's like math. You can't do algebra without first knowing basic arithmetic operators and order of operations.

    -- Bill Stewart [Bill_Stewart]

    Thursday, July 26, 2018 3:12 PM
  • let me see if I get this Bill

    "Specifies an array of modules. This cmdlet [i.e., the Get-Command cmdlet] gets the commands that came from the specified modules or snap-ins."

    I did some more searching.  this is what I have found.  I think I understand the whole line. I got stuck on Module.  The rest was clear as a bell

    basically get a group of commands that are imported from module and show me only those command that are from the module TCPIP.

    Array - group 

    Module - commands that have been imported.

    if this is true than -module makes sense.

    as a Systems Engineer.  I don't have a degree.  I am a MCSE and that is how I got into that position.  I didn't study languages, mine was pure network, AD, Exchange, Citrix, etc. study.  Can you suggest a book that I can use to help further my program knowledge or even a language that would give me a hand up on learning PS.  So far it is pretty straight forward. the Module is what threw me.

    thanks for your input.  I really love what I have learned so far.  It is very foreign to me but very fun to see how things work.  I can't believe I am working from a "command line" environment.

    By the way Snap-in is something I know very well and has helped me to do what I need to do very quickly, instead of hunting for it.



    Thursday, July 26, 2018 4:53 PM
  • as a Systems Engineer.  I don't have a degree.  I am a MCSE and that is how I got into that position.  I didn't study languages, mine was pure network, AD, Exchange, Citrix, etc. study.  Can you suggest a book that I can use to help further my program knowledge or even a language that would give me a hand up on learning PS.  So far it is pretty straight forward. the Module is what threw me.

    thanks for your input.  I really love what I have learned so far.  It is very foreign to me but very fun to see how things work.  I can't believe I am working from a "command line" environment.



    I, too, am an MCSE but started at 12 building computers and learning programming (1960).  Programming was the best part along with learning math, number theory and logic.

    Do the video tutorial and you will get pretty knowledgeable about programming with PowerShell.  Don't waste time on guessing.  Your guesses are close but still show you haven't understood PowerShell.  The commands you are asking about have nothing to do with programming.  They are just commands like "dir" or "type" in CMD.EXE.

    The tutorial will show you how to navigate the PwoerShell scripting system.  It will make using PowerShell very easy.  It will take you a year or more to learn what the short tutorial will show you.


    \_(ツ)_/

    Thursday, July 26, 2018 5:05 PM