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 - Наука
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
No way! I started learning ps a week ago and now you continue the series :D
Thank you very much for your awesome work!
Amazing tutorial and the best I've see about PowerShell functions. Thank you so much!
Like Moss from the IT-Crowd would say, "This is INSANELY brilliant!"
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.
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.
Amazing explanation. Way better than Microsoft's documentation :-D
Learning a lot with these series! thanks!
Great presentation. Thank you for your efforts!
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.
Super helpful and just what I needed; thank you for the completeness of this video!
Very nice. Great video.
Thank you very much!! Really Helpful!!
Thanks for bringing powershell functions. If possible please keep on bringing new videos. It's very heplful
More to come!
Great tutorial thanks a lot!
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?
Finally, I can start to make my vim-plug manager lol
I must know how you make your cursor blink in that style! Very pleasing compared to a flashing cursor
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.
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?
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.
Great tutorial but the difficulty spike of this from pws logic vid is massive.
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?
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!