Need to Learn Powershell Fundamentals in 1 Night

bugzy3188bugzy3188 Member Posts: 213 ■■■□□□□□□□
Hello All,
I posted earlier about a job interview that I had recently gotten that is scheduled for tomorrow afternoon. I was going through the job description and company profile with a fine tooth comb and I suddenly realized that this is a step above the typical help desk job that I had originally thought that it was, this job is going in to Systems Admin territory! The actual title is System Technician. Now most of my experience does match up with the position, I have worked with servers, installed patches, configured AD, GP, WSUS, I have basically done everything that is involved with setting up a domain from scratch, however, the job description does state that the candidate must have proven experience with scripting using PowerShell to “deploy OS and software changes”. With that being said, all of my experience has been for small businesses, small enough to where automation hasn’t been deemed necessary by management, thus I have a big fat goose egg in the PowerShell/scripting department. Now I am not trying to be unrealistic here but I really need to get a base knowledge of this stuff before tomorrow morning so at very least I can give some sort of response when the question is asked, does anyone have any advice/info.? Admins, what are your most common uses for PowerShell scripts? I am heading over to Youtube now to get an idea of what I am up against but if anyone has any resources that could help give me a thousand foot view at the very least it would be much oblidged.

Thanks!
If you havin frame problems I feel bad for you son, I got 99 problems but a switch ain't one

Comments

  • RìpshotRìpshot Member Posts: 14 ■□□□□□□□□□
    Probably too late, but there is regular PowerShell then the PowerShell ISE. If you use ISE you can actually see the commands as provided in all modules (AD, Scheduling, other Cmdlets).

    This is a very basic overview Windows Powershell - In Windows 7 How to Install, Run & Uninstall It - YouTube

    If you have past experience deploying using WSUS you could use those similar scripting methods and apply them with PS. Now, either they have scripts already setup (most likely), or if not they may require you to write them. For example, if they have a different deployment method than using WSUS.

    Article for PS and WSUS How to install approved WSUS updates via PowerShell or other method.
  • QordQord Member Posts: 632 ■■■■□□□□□□
    Getting Started with PowerShell 3.0 - Microsoft Virtual Academy

    Start there, best beginner level stuff I've seen for powershell. My most common uses are really anything that I normally do in the gui, and I'm starting to get faster at the prompt now at many things than I am via the gui.

    For deploying server OS specific, check out the desired state config:
    http://blogs.technet.com/b/privatecloud/archive/2013/08/30/introducing-powershell-desired-state-configuration-dsc.aspx

    Another "fun" way of getting ideas is to look and see what other people are doing with it. When I'm not lurking around techexams, I can be found lurking the spiceworks forums:
    http://community.spiceworks.com/scripts/language/3
  • cyberguyprcyberguypr Mod Posts: 6,928 Mod
    Best advice I ever gotten regarding PowerShell was last year TechEd. The guy doing the presentation said "the absolute most important command you need to know how to use is get-help."

    The use cases for PS are virtually endless. Microsoft products natively support it and it many storage, networking, and computing vendors are jumping in to support it. Since you are out of time, just focus on understanding what it does. Understand it is part of Microsoft's Common Engineering Criteria and its main purpose is to automate operations.

    DO NOT try too hard to go into what you jut don't know or you will kick off the interviewer's BS meter.

    Best of luck!
  • dmoore44dmoore44 Member Posts: 646
    That's kind of a rough question to ask... There's "basics" (variables can be typed, or not; variable declarations start with a $)... and then there are basics (Invoke-SqlCmd allows you to execute SQL code, Get-ADComputer gets a details about a computer object, Get-WmiObject allows you to query WMI)...

    So, in the end, it all depends on what you need.
    Graduated Carnegie Mellon University MSIT: Information Security & Assurance Currently Reading Books on TensorFlow
  • DigitalZeroOneDigitalZeroOne Member Posts: 234 ■■■□□□□□□□
    pluralsight.com has a free trial and they have a short almost 3 hour intro to powershell video series. It may not be too bad, since a lot of job descriptions sound like you'll be doing everything, but a lot of times it's narrowed down to just a few job duties.

    Here is some starting info. In powershell the commands are called cmdlets, and they are a verb-dash-noun (singular noun)

    All real cmdlets:

    get-service
    stop-service
    new-item
    set-location


    You can use the | character (pipeline) to take the output of one cmdlet as the input for the next cmdlet

    get-service -name ALG | stop-service (This would get the Application Layer Gateway Service, and then that service would go through the pipeline and it would be stopped.)

    The -name in get-service is a parameter, just like a switch on the command prompt in windows ifconfig /all. Parameters start with a dash in powershell.

    The cmdlets to know would be:

    Get-help cmdlet name i.e., get-help get-service
    get-member (use the pipeline) i.e., get-service | get-member (used to find out what type of objects you're working with)
    get-command cmdlet name i.e., get-command get-help (no pipeline) get-command -verb get (This would get cmdlets that start with the verb get )

    Good luck with the new job (yes, I'm claiming it for you)
  • Cert PoorCert Poor Member Posts: 240 ■■■□□□□□□□
    It's feasible in 1-2 hours if you open up the PS prompt on your box and get familiar running basic commandlets. Pipelining is really huge and useful. Try to run one command-let then | to something else, say sorting, then | again and output it to a table or something.
    In progress: MTA: Database Fundamentals (98-364)
    Next up: CompTIA Cloud Essentials+ (CLO-002) or LPI Linux Essentials (010-160)
    Earned: CompTIA A+, Net+, Sec+, Server+, Proj+
    ITIL-F v3 2011 | ServiceNow CSA, CAD, CIS | CWNP CWTS
  • stryder144stryder144 Member Posts: 1,684 ■■■■■■■■□□
    You also might want to mention that you don't really know PowerShell but that you've been researching it and you are trying to learn it. Being open and honest will impress most hiring managers. Plus, if they know that you are trying to learn it (tell them the resources you are using), they will know that you don't just sit there, you learn actively. That shows them that you are eager and, ultimately, teachable.

    Good luck!
    The easiest thing to be in the world is you. The most difficult thing to be is what other people want you to be. Don't let them put you in that position. ~ Leo Buscaglia

    Connect With Me || My Blog Site || Follow Me
  • lsud00dlsud00d Member Posts: 1,571
    The following is very important:

    get-command reads and displays information
    set-command or new-command writes information

    You can do 'get' all day but be careful when you actually modify objects and always be aware of the consequences!
  • ITcognitoITcognito Member Posts: 61 ■■□□□□□□□□
    How much of a challenge would you say it is to go from scripting in Bash, Perl, and Python to Powershell ?
  • lsud00dlsud00d Member Posts: 1,571
    It's very straightforward once you get the basics. PoSH even has bash aliases but I would recommend learning the PoSH commands as the aliases are a crutch and lose their efficiency at a point.

    PoSH has a lot in common with bash as far as piping goes so that translates over fairly well. If you have a decent understanding of bash scripts, google how that translates to PoSH and then you will better understand the flow of PoSH.

    Also it takes from Python in that you import modules once you need to work outside the basic framework of PoSH, like with Exchange, Active Directory, or some of the System Center suite.
  • bugzy3188bugzy3188 Member Posts: 213 ■■■□□□□□□□
    Wow, I really couldn't have asked for a better response from the community than what you all have given, thanks! I stayed up late learning at very least what PowerShell is and what its potential uses are, as well as basic functions so at least I will have something to respond with if they ask any questions about it. I must say that even if the job didn’t pull through, I think I would like to learn more about PowerShell whether my company uses it or not, what a great tool!

    Thanks Again!
    If you havin frame problems I feel bad for you son, I got 99 problems but a switch ain't one
  • NyblizzardNyblizzard Member Posts: 332 ■■■■□□□□□□
    Awesome thread and the best of luck to you!
    O
    /|\
    / \
  • lsud00dlsud00d Member Posts: 1,571
    Powershell Tips.doc

    No problem, I hope all goes well--let us know!

    For OP and those interested, I have a quick 'tips and tricks' document that I made for my purposes for easy reference. It's not exhaustive and I add to it whenever I find cool ideas but if you come from a *nix background (as I did) I find it cuts to the chase of things I want to accomplish. It's focused more towards one-liners than scripting.
  • bugzy3188bugzy3188 Member Posts: 213 ■■■□□□□□□□
    Well its hard to say at this point how the interview went. I feel like I did pretty well all things considered. With that said the Powershell/Scripting questions were less "what do you know" than "What have you done" I was honest and said I haven't had much experience deploying software via script outside of a lab environment, I feel like I could sense them writing the negative comments on their sheets of paper. Other than that I feel as though I was able to demonstrate the level of technical knowledge and soft skills that would fit the position. The position is more of an intermediary between the System Adkins and the Help Desk BTW. All I can say is I remain cautiously optimistic. Thanks again for all of the feed back...
    If you havin frame problems I feel bad for you son, I got 99 problems but a switch ain't one
  • dmoore44dmoore44 Member Posts: 646
    OP,

    In case you're interested, here's my Powershell repo at Github: https://github.com/dmoore44/Powershell
    I'm planning on adding more of the scripts I've written, as soon as I can...
    Graduated Carnegie Mellon University MSIT: Information Security & Assurance Currently Reading Books on TensorFlow
  • lsud00dlsud00d Member Posts: 1,571

    I had a perl script I always called to do this in my bash scripts icon_cheers.gif
Sign In or Register to comment.