PowerShell Scripts

Поделиться
HTML-код
  • Опубликовано: 11 июл 2024
  • Learn how to create and run PowerShell Scripts. In this episode of Learn PowerShell I live code a PowerShell script from start to finish. Follow along to see the thought process and workflow that goes into scripting PowerShell solutions and writing your own PowerShell scripts.
    Corresponding TechThoughts write-up:
    www.techthoughts.info/powersh...
    ▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
    00:00 - Intro
    00:26 - Live coding a PowerShell script
    43:06 - Executing PowerShell scripts
    48:00 - Outro
    Learn PowerShell - Episode 10 - PowerShell Scripts
    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
    How to create a Telegram Bot: • How to Create a Telegr...
    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
  • НаукаНаука

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

  • @henton75
    @henton75 4 года назад +21

    Hey man, you are one hell of a teacher! Your walk-through is extremely clear and thorough! I especially love the way you break down your thinking when planning the structure of the script. Very very good! Keep the videos coming, cause I’m learning a lot.
    I just finished one of my first really useful scripts today and boy, was that satisfying! Can’t get enough of scripting so I look forward to the next lesson.
    THANKS!

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

    Thank you for including the thought processes

  • @abraheemyasin4817
    @abraheemyasin4817 Год назад +3

    Amazing video, this series is probably the best on RUclips. Thank you so much for your hard work

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

    It's crazy how good this video is.

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

    Thank you for this series. Your presentation is very clear and easy to follow.

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

    Very informative, detailed and with good instruction to follow!

  • @craigdahl155
    @craigdahl155 Год назад +2

    Brilliant Course! Best on RUclips by a country mile

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

    Wonderful lesson. Thanks for that!

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

    interesting lesson, easy to follow along :)

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

    Great lesson!

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

    Excellent video, sir!

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

    Great video! I made the info and errors display in the Powershell command prompt as well with the write-host command and added dates to the logs with $date = Get-Date.

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

    Amazing explanation...Thanks Man..

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

    Awesome Tutorials....! Thank you very much..... 🤩

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

    Excellent video! Talking through your process was very beneficial.

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

    Crystal clear 💎

  • @AI-Awakes
    @AI-Awakes 2 года назад +1

    This is a great Video. I'll follow you and learn from you. PowerShell is now very interesting to me.

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

    Amazing video thank you

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

    Very good thanks

  • @dionysos93120
    @dionysos93120 4 года назад

    Great explained job Bro

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

    I have never seen like a video like this..it’s a great explanation😊😊😊really really thank you for the video

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

    Hands down the best series on Powershell.

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

      One of the best, check out don jones. Also other RUclipsrs I can't remember their names

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

    Great job, This is golden, I hope you are okay, recently discover your channel and your job and you are helping my a lot.
    Sorry English is not my mother language.
    Is very interesting the part you mention about the cronjob and the section with linux, Will be amazing watching you in more videos.

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

    Thank you, bro !)

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

    Excellent video here. Love the thoroughness and checking of your logic and “showing your work”. I have a question though... instead of using Param could you also use Read-Host to get the users input? That’s typically how I handle it but I appreciate knowing to use param now.

  • @azhar8178
    @azhar8178 4 года назад

    Superb

  • @user-mi2bb8bm6s
    @user-mi2bb8bm6s 2 года назад +1

    감사합니다 선생님

  • @brawlmania7544
    @brawlmania7544 3 года назад +5

    Another thing you could have done was put a time stamp for the errors so you would be know when the error occurred.

  • @z3lt0
    @z3lt0 4 месяца назад

    Hello man, this playlist is amazing. Question what's the extension for splatting? tks

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

    Maybe I missed someone else saying this but at the verify Poshgram section around 19:35 or so, you have the [Error] marked as [Info] in the downloadable documentation. I suppose it really doesn't affect the script but thought I'd mention it.
    TY for the great content.

  • @TheMostEpicThing
    @TheMostEpicThing 4 года назад +8

    Amazing lesson, you present this in such a great and simple way, it makes sense and easy to understand, this is coming from a totally brain dead guy, you got me interested in this topic as Im watching all of the videos on your channel now, instantly subscribed and liked for sure, well done sir

  • @sunset203
    @sunset203 Месяц назад

    From a text file I want to import the information into an Excel box to fill in certain set fields. Is it possible to do that?
    Thanks!

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

    I've always been better in reading scripts than actually writing, but this has been very useful around the thought process. A bit like requirement gathering 🙂.
    Also, where can we located that splatting module for VS Code? TIA.

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

      Its requires a bit of advanced setup, but here is the tool that allows converting to splat: github.com/SeeminglyScience/EditorServicesCommandSuite

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

    Awesome video series. I've truly enjoyed it. Had a question around the [4:11] what is that powershell terminal window and how do you get it configured like that?

    • @svvm.sudhakar
      @svvm.sudhakar 3 года назад

      He customized his PowerShell profile..
      Hope we will get one video on the same "how he had done that.."

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

      Windows Terminal.
      There is an excellent series on how to get it customized here:
      www.hanselman.com/blog/how-to-make-a-pretty-prompt-in-windows-terminal-with-powerline-nerd-fonts-cascadia-code-wsl-and-ohmyposh

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

    Great video, I think you missed one throw! Should there have been one if PoshGram couldn’t be loaded? You logged it but wouldn’t the script have then tried to send the message anyway?

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

      EXCELLENT catch, and one that speaks to your PowerShell capability! I've corrected it on the course's GitHub: github.com/techthoughts2/Learn-PowerShell-Code-Examples/blob/master/LearnPowerShell/EP10%20-%20PowerShell%20Script.ps1#L121

  • @daephx
    @daephx 4 года назад +3

    I like your style. Also what theme is that for vscode?

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

      marketplace.visualstudio.com/items?itemName=vangware.dark-plus-material

  • @RobertoHernandez-xf9et
    @RobertoHernandez-xf9et 4 года назад +3

    EP9 done! 3:59am, now I'm going to bed for sure. RUclips autoplay EP10...¿They are gonna script from scratch and message me if any windows or linux server is below 20% space? I will need more soda and more jumping jacks...Damm YT autoplay. I can't get no sleep.

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

    Hi what's the name for the plugin for ConvertToSplatExtension? Can't find it on VS Marketplace.

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

      github.com/SeeminglyScience/EditorServicesCommandSuite

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

    silly question. but what keybind you open the "select command" in vs code

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

      I'm not sure I understand the question, can you provide additional detail?

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

    My brain hurts but i am learning

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

    Why you made a if for windows/linux and used get-volume on windows if Get-PSDrive works just fine on Windows, I just tested on PS 7.3 and 5.1 both works just fine.

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

    Get-command _Module Poshgram shows nothing. Please help

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

    Can't seem to get ConvertToSplat working. Even after installing EditorServicesCommandSuite from gallery and adding it to VSCode Profile. It just doesn't come up after installing and when i search in the Command Palette. Anyone else having same issue?

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

      It can be quite tricky to get working.
      First, as of today you have to install the pre-release version:
      Install-Module EditorServicesCommandSuite -Scope CurrentUser -AllowPrerelease -RequiredVersion 1.0.0-beta4
      Then you have to add this to the VSCode powershell profile:
      if (Get-Module -Name EditorServicesCommandSuite -ListAvailable) {
      Import-Module EditorServicesCommandSuite -ErrorAction SilentlyContinue #workaround
      Import-Module EditorServicesCommandSuite
      Import-EditorCommand -Module EditorServicesCommandSuite
      Import-CommandSuite
      }

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

    The install module won't do anything with me why?? I tried to test if it's installed but also nothing only the find module would work

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

      What error are you getting?
      Are you running as admin?

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

      @@Techthoughts2 yup as running admin as for errors I'm getting nothing it just won't work 😟

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

      @@immortal9929 same here

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

    what if you do not show Platform in windows at the terminal screen?

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

      I'm not sure I understand the question, can you provide additional detail?

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

      Powershell 5 does not show platform with $psversiontable. This tutorial is based on version 7.

  • @PAUL-eq6ot
    @PAUL-eq6ot 4 года назад +1

    Life is so much easier if you can get an imsi catcher lol

  • @mikemilkshake205
    @mikemilkshake205 4 года назад +1

    When new video ?

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

    wait won't the \ in linux is an escape character ? that won't work in "$logpath\

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

    is it possible to create a programming language with powershell if possible how to create it

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

    I found treasure

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

    everytime he says log take a shot

  • @bottle-xz5hp
    @bottle-xz5hp 3 года назад

    Most of the video said nothing about how to get this script to run automatically from time to time
    It just makes no sense to send message to telegram when the user initiates this script manually anyway.

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

      You can tie it to scheduled task or cron job.