PowerShell Input & Output

Поделиться
HTML-код
  • Опубликовано: 11 июл 2024
  • Learn how to take in more dynamic PowerShell input and generate various types of PowerShell output. Take more control of your PowerShell Input & Output in this short video demo. See examples of how to prompt for user input, retrieve information from the web, and use PowerShell to get file content as your input. Wrap up with various demos on how to output to console and file.
    Corresponding TechThoughts write-up:
    www.techthoughts.info/powersh...
    ▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
    00:00 - Intro
    00:27 - Dynamic input using native cmdlets
    06:00 - Input using Read-Host
    07:50 - Input from files using Get-Content
    13:03 - Input from csv using Get-Content
    14:18 - Output using Write-Host
    16:52 - Output using Write-Output
    18:12 - Output using Out-File
    20:31 - Outro
    Learn PowerShell - Episode 7 - PowerShell Input & Output
    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
  • НаукаНаука

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

  • @sanghvian
    @sanghvian 3 года назад +15

    This series is proof that treasure does exist on this planet 👏🏻

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

    Learned a lot, truly great tutorial.

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

    Honestly.. I watched Pluralsight course videos..and this playlist is 100x better than Pluralsight!

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

      That means a lot!

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

      Absolutely. RUclips does have some great teachers who explain way better than some $1000 paid courses.
      The challenge is to find them out.
      It's even tougher now that RUclips has removed the dislike counts.

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

    Nice tutorial, thanks :)

  • @s.baskaravishnu22
    @s.baskaravishnu22 2 года назад +2

    Many thanks for giving code

  • @revolvur2622
    @revolvur2622 2 года назад +2

    Hi TechThoughts. Extremely grateful for your tutorials. How would i adjust the title length in '$posts | Select-Object Title,Score | Sort-Object Score -Descending'? Some of the reddit post lengths are way too lengthy. Thank you.

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

      You can use Format-List instead:
      $posts | Select-Object Title,Score | Sort-Object Score -Descending | Format-List
      If you have to use Format-Table, it is unfortunately pretty tricky to define custom column widths for a table:
      stackoverflow.com/questions/38554966/controlling-column-widths-with-format-table

  • @chris8534
    @chris8534 11 месяцев назад

    How I wish the working files were at the github link to follow along.

  • @harigpriya7
    @harigpriya7 11 месяцев назад

    while i was trying with this line $objData = $rawJSON | ConvertFrom-Json ... it is throwing below error ''Conversion from JSON failed with error: Unexpected character encountered while parsing value:

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

    where can I get the Sample.log file

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

    the font is too small

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

      Thanks for the feedback. It looks like I didn't increase it on this lesson. I'll make sure that subsequent videos have a larger font.

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

      @@Techthoughts2 Looks good on my 1440p monitor :)

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

    I can retrieve only one object, I just copy-paste code from your site sill it is retrieving only one object

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

      Please paste the code you are having issues with.

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

      @@Techthoughts2
      #retrieve dynamic content from a website
      $webResults = Invoke-WebRequest -Uri 'reddit.com/r/powershell.json'
      $rawJSON = $webResults.Content
      $objData = $rawJSON | ConvertFrom-Json
      $posts = $objData.data.children.data
      $posts | Select-Object Title,Score | Sort-Object Score -Descending
      I tried both Desktop and core edition but it returns only one object

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

      I have verified that this code does indeed work as intended. Can you please indicate the error you are receiving? Can you clarify what you mean by only one object? You should only be receiving one object, the json payload. But, it can be drilled into to discover many sub properties containing content.

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

    Font size is too small, can't see.....