PowerShell Functions

Поделиться
HTML-код
  • Опубликовано: 3 июл 2024
  • Learn how to work with PowerShell Functions. In this episode of Learn PowerShell I dive into what makes up a PowerShell Function. Discover the difference between an advanced and standard PowerShell function. I also tackle the question of why you might write a PowerShell Function vs PowerShell Script. Go beyond theory - this episode uses real life fully functional PowerShell Functions to explore how functions are made and how they operate.
    Corresponding TechThoughts write-up:
    www.techthoughts.info/powersh...
    ▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
    00:00 - Intro
    00:26 - Anatomy of a PowerShell Function
    04:23 - Function vs Script
    06:20 - Get-PublicIP Function Example
    07:58 - CmdletBinding
    11:05 - PowerShell Function Parameters
    17:43 - Get-Weather Function Example
    20:41 - Begin Process End
    23:53 - PowerShell Function Scopes
    27:26 - Final Example Get-Reddit
    34:16 - Recap
    35:34 - Outro
    Learn PowerShell - Episode 11 - PowerShell Functions
    Reference PowerShell code examples from this episode:
    github.com/techthoughts2/Lear...
    Check out the complete Learn PowerShell RUclips Playlist:
    • Learn PowerShell
    ~
    / jakemorrison
    My recommended books for learning PowerShell:
    (these affiliate links cost you nothing extra and help support this channel)
    - Learn PowerShell in a Month of Lunches: amzn.to/3mlbizz
    - Learn PowerShell Scripting in a Month of Lunches: amzn.to/3MtxJxe
    - Windows PowerShell in Action: amzn.to/3xkjGp4
    - PowerShell Cookbook: amzn.to/3tgCq6F
    If you are able, and found this content valuable, please consider a secure donation in the link below. Your contribution helps offset the costs of producing this PowerShell series. Much appreciated!
    www.paypal.com/cgi-bin/webscr...
    Learn PowerShell online free in this operationally focused PowerShell series. These PowerShell tutorials are designed to get you ramped up and using PowerShell quickly. Each episode provides practical PowerShell examples for using PowerShell in the real world. Whether you are a PowerShell beginner or seeking advance PowerShell training, this Learn PowerShell series covers the topics you'll need to be effective with PowerShell!
    These videos were recorded on a lot of my older equipment.
    My newer videos use the following equipment:
    - Camera: amzn.to/3MsjQPu
    - Lens: amzn.to/3NrsKhJ
    - Teleprompter: amzn.to/3monqQc
    - Mic: Audio-Technica AT2035
    - Mic Preamp: amzn.to/3tlOvY6
    - Mic Arm: amzn.to/3NXJTiP
    - Audio Interface: amzn.to/3xqPqJu
    - Lighting: amzn.to/3O1Z2zR
    - Rear color lighting: amzn.to/3H5MIMI
    #learnPowerShell #PowerShell #PowerShelltraining #PowerShellTutorial
  • НаукаНаука

Комментарии • 25

  • @George71231
    @George71231 Год назад +8

    I wish I could like this many more times, I have spent weeks reading and trying to understand functions. This 30ish minute video has shot my confidence and understanding of functions through the roof and I look forward to building my own functions now. THANK YOU for making this video, it's been a tremendous help, so much more to discover on my own but I have learn enough here to feel confident moving forward.
    Edit:
    One month later and I have grown to making my own modules and even manifests. Been sharing the tools I've made and this all around has been so useful

  • @skorp5677
    @skorp5677 4 года назад +7

    No way! I started learning ps a week ago and now you continue the series :D
    Thank you very much for your awesome work!

  • @boazrosen1327
    @boazrosen1327 Год назад +1

    Amazing tutorial and the best I've see about PowerShell functions. Thank you so much!

  • @Tegle9
    @Tegle9 2 года назад +4

    Like Moss from the IT-Crowd would say, "This is INSANELY brilliant!"

  • @conservativeimmigrant6608
    @conservativeimmigrant6608 3 года назад +2

    Went on and donated since this is one of the best courses on coding. The info is available everywhere but the structure and the practical examples makes the difference.

    • @Techthoughts2
      @Techthoughts2  3 года назад +3

      Many thanks. You are the first person that donated, and it was much appreciated. I never got around to linking the account, and as a result, you were refunded. But I appreciate the gesture and thanks for being the first person to donate. It means a lot.

  • @prasadsardeshmukh3898
    @prasadsardeshmukh3898 4 года назад +6

    Amazing explanation. Way better than Microsoft's documentation :-D

  • @MeOnTheStreets
    @MeOnTheStreets 3 года назад +1

    Learning a lot with these series! thanks!

  • @yavor1
    @yavor1 4 года назад +2

    Great presentation. Thank you for your efforts!

  • @timmy_team_6285
    @timmy_team_6285 Год назад

    As a DevOps engineer who uses PS alot, I learnt a few things and my knowledge was solidified further after watching this. Nice video! Subscribed.

  • @c016smith52
    @c016smith52 Год назад +1

    Super helpful and just what I needed; thank you for the completeness of this video!

  • @RPG_ash
    @RPG_ash 4 года назад +4

    Very nice. Great video.

  • @wasimbagwan5715
    @wasimbagwan5715 2 года назад +1

    Thank you very much!! Really Helpful!!

  • @abhishekkumar-zs1le
    @abhishekkumar-zs1le 4 года назад +1

    Thanks for bringing powershell functions. If possible please keep on bringing new videos. It's very heplful

  • @haddocks
    @haddocks Год назад

    Great tutorial thanks a lot!

  • @kolesplace
    @kolesplace 2 года назад

    You have some great instructions. Do you have instruction on the higher level aspects of PowerShell. I have written functions but did not know until I watched this video that I need to type (. ./filename) for my file to be recognized. What does that do?

  • @ahmaddynugroho
    @ahmaddynugroho 3 года назад

    Finally, I can start to make my vim-plug manager lol

  • @CaptainQwerty
    @CaptainQwerty 3 года назад +1

    I must know how you make your cursor blink in that style! Very pleasing compared to a flashing cursor

    • @dorko3031
      @dorko3031 2 года назад +1

      Saw that too and had to research. Add config "editor.cursorBlinking" to settings.json with options of 'blink', 'smooth', 'phase', 'expand' or 'solid'. 'Expand' is the one used in the video.

  • @Cyrixau
    @Cyrixau 3 года назад +1

    How many more videos in the series do you think are left? Also do your blog posts contain all the same info from the youtube vids?

    • @Techthoughts2
      @Techthoughts2  3 года назад +1

      That's a good question. Currently I'm aiming for 15 episodes, but that may end up changing. Let me know if there is something specific you'd like to see covered! Blog posts and videos are pretty similar. The goal was to provide the same content for both, so people could choose their preferred learning format.

  • @zeroexct
    @zeroexct Год назад

    Great tutorial but the difficulty spike of this from pws logic vid is massive.

  • @kalyanben10
    @kalyanben10 3 года назад +1

    right after the function ends.. why do you comment function name? At @25:30 , right after function definition ended, you commented on its name.. is there any advantage or just for clarity?

    • @Techthoughts2
      @Techthoughts2  3 года назад +2

      Great question.
      When you start writing a lot more functions, and grouping functions together.
      It can help to see when a function stops/starts.
      So yes, I have gotten in the habit of including the function name in a comment at the end.
      When you stare at 6,000+ lines of code it can help to see when a function stops!