How to use Write-Host for PowerShell

Sdílet
Vložit
  • čas přidán 11. 09. 2024

Komentáře • 70

  • @robbybaggio4007
    @robbybaggio4007 Před 7 lety +8

    I think this is one of your coolest videos. Thanks for covering the write-host cmdlet. PPL like to whine about the smallest most insignificant things. The command is there to be used. If someone doesn't want to use it, he/she can stop using it and keep it to themselves. I find it to be useful

  • @shuttlepodone1707
    @shuttlepodone1707 Před 4 lety +2

    Thank you! I watched this video Saturday evening and used Write-Host just now for work it worked like a charm for exactly what I needed!

  • @rickyp9803
    @rickyp9803 Před 7 lety +4

    Thank you Shane for sharing your knowledge. Just started getting serious about learning PS this week and have been burning the midnight oil every day. Your video helped me understand more about the Write-Host Cmdlet.
    Have subscribed, tómalo suave.

    • @ShanesCows
      @ShanesCows  Před 7 lety +1

      Awesome! Hopefully, you found all of the different PowerShell videos already. If there are any topics not covered you would like to see please let me know.

    • @rickyp9803
      @rickyp9803 Před 7 lety

      Yes, I clicked on your link and started to check them on my other 'Task View' desktop. Have added a CZcams Bold Zebras to a PowerShell folder I've built to organize my PS studies, so Lord willing I'll complete them soon.
      Thanks again for your efforts and will keep in touch with questions and topics I'd like to see. Going back to learning.

  • @SkateboardingWithYerDa
    @SkateboardingWithYerDa Před 2 lety +1

    This has been a massive help to me, Thanks! I'm currently learning the basics of Powershell for my Engineering degree project, need to figure out how to import serial data from an Arduino into Powershell so I can automatically send an email when certain conditions are met. Gonna check out some of your other videos now! (shane is cool btw 😏)

    • @ShanesCows
      @ShanesCows  Před 2 lety +1

      Glad the content is helping! Have a good day.

  • @ricsmith6464
    @ricsmith6464 Před 5 lety +6

    5:13 Well, that escalated quickly. Great job though, easy to understand and learn from.

    • @ShanesCows
      @ShanesCows  Před 5 lety

      Yeah I do that sometimes glad it worked out.

  • @Manojkondeti
    @Manojkondeti Před 6 lety +4

    Shane is cool

  • @bjoernf73
    @bjoernf73 Před 14 dny +1

    What I don’t understand about this, is that at 2:56 or thereabout, you start talking about the non-fact that it is a down-side that write-host doesn’t write it’s things anywhere else. That is the up-side, it’s not a down-side. Your log messages do not get cluttered into the output of say, a function. In your function, you can do write-hosts to tell what happens at various stages, and those messages are not cluttered into the thing you calculated in your function, and that you wanted to return. That is not a down-side, it is an up-side.

    • @ShanesCows
      @ShanesCows  Před 14 dny +1

      I agree with you, but some of the pureist don't like it. 🤷Either way, hopefully everyone knows and can make decisions. 😎

  • @rajeshYYYY
    @rajeshYYYY Před 6 lety +2

    Hi Shane,
    How do I
    "This is text 1" "This is text 2 " "This is text 3" $Some_output | Out-file c:\test.txt
    Looks like out-file does not take more than one string, if so suggest alternative please.

    • @ShanesCows
      @ShanesCows  Před 6 lety +2

      Out-File -Append
      That will let you just keep adding text to an existing file.

  • @kamalaarumugam6103
    @kamalaarumugam6103 Před 5 lety +1

    Nice video Shane. You are awesome in teaching :)

  • @lahernandezs
    @lahernandezs Před 7 lety +1

    Thanks a lot Shane! very useful!

  • @redwooddunken732
    @redwooddunken732 Před 7 lety +2

    Thanks

  • @vasillilov9524
    @vasillilov9524 Před 4 lety +1

    I think that Write-Host is not giving you an object to work with... most probably most of the people use it for putting somethin on the screen which is not what we want when automating some stuff. That is my personal opinion. However really nice video I haven't use Tee-Object I will check it on MS Docs

    • @ShanesCows
      @ShanesCows  Před 4 lety +1

      Fair. Write-host has its downfall but also its uses. 😎

  • @keyzawarsame2354
    @keyzawarsame2354 Před 3 lety +1

    This is awesome

  • @siddharthchand7243
    @siddharthchand7243 Před 3 lety

    I preferred watching your videos for free rather than doing some paid course. pretty cool content!

  • @globalplaylist6535
    @globalplaylist6535 Před 6 lety +1

    You are awesome!
    Tnx

  • @PabloVillaronga
    @PabloVillaronga Před 4 lety +1

    Great Video share, i learn a lot , the easy way ! Wouldn;t be great if you post the link to the powershell you explained to Github or your site,like a blog ? Would be easy to execute and get out exercises !

  • @drakouzdrowiciel9237
    @drakouzdrowiciel9237 Před 5 lety +1

    Gotta love that PS code...

  • @pradyumnanaik8107
    @pradyumnanaik8107 Před 3 lety +1

    How to Output with the help of Write-GridLog? Where to get its Documentation

  • @johnmandrake8829
    @johnmandrake8829 Před 3 lety +1

    haha I bet the one dislike was for the killing the cat joke

    • @ShanesCows
      @ShanesCows  Před 3 lety

      Probably wasn't the nicest thing to say. Whoops. 🤷‍♂️

  • @limacal
    @limacal Před 6 lety +1

    Thank you very much for teaching us PowerShell.
    I used to use VB but now PowerShell.
    I will be watching all your Videos, so that I can learn more about PowerShell :)
    Trying to write a script at work using PowerShell but sometimes I can't run it because of the GPO settings.
    Any suggestions would be appreciated!
    For example:
    Do you know what GPO I have to modify in order to run a script to Uninstall/Install Programs Remotely?
    Actually, we are using PSexec.exe in PowerShell, and we cannot run PSexec unless if I manually run it as Admin.
    So, I would like to know what GPO has to be changed and how we can run PSexec in PowerShell as Admin (or System account) without typing the password or something.
    Thank you

    • @ShanesCows
      @ShanesCows  Před 6 lety +1

      Hey Carlos - i am not really sure. Are you on Twitter? Happy to Retweet and see if any of my super nerd friends can help.

    • @limacal
      @limacal Před 6 lety +3

      Shane, thank you for your prompt reply.
      Unfortunately I'm not on Twitter, I only have Facebook :(
      By watching your videos I actually got my PowerShell working at work. Thank you so much for posting all the videos, I will be watching all.
      I already told my co-workers that I am taking PowerShell classes lol
      The issue I had it was an old script that the company had which it was using PSexec to install programs, so I got it to work without using it.
      Love it.
      Thanks Shane

    • @ShanesCows
      @ShanesCows  Před 6 lety +1

      Very cool. Congrats

  • @AlexVi
    @AlexVi Před 3 lety +1

    How can i use Write-Host message even if i just type enter without any info?

    • @ShanesCows
      @ShanesCows  Před 3 lety

      NOT sure. What are you trying to accomplish?

  • @babaijebu6462
    @babaijebu6462 Před 7 lety +1

    Great stuff

    • @summer44ism
      @summer44ism Před 6 lety

      Thanks Shane! This is Super Helpful from Super Cool Shane! lol. Do you plan to do a lesson on working with SQL via Powershell? I need to capture data from a query to a file. I'm using ForEach because I have over 300 servers that I am querying, 1 by 1...But I can't seem to capture the data that I am querying. Please let me know if there is another video for that!! Have a great one!!

  • @ulfgj
    @ulfgj Před 6 lety +2

    ur so fun to watch. man! :D

  • @so9kevin
    @so9kevin Před 4 lety +1

    How about Powershell with telnet terminals?

  • @mohanr4375
    @mohanr4375 Před 6 lety +1

    Hi Shane, doing a great job thanks, I need list of power shell topic for Server administrator

    • @ShanesCows
      @ShanesCows  Před 6 lety

      This playlist should be a solid start. czcams.com/video/IHrGresKu2w/video.html

    • @mohanr4375
      @mohanr4375 Před 6 lety

      Shane Young thanks

  • @koyalposhala2563
    @koyalposhala2563 Před 4 lety +1

    Hi Shane
    Can we except video on AZ-Deployment from you??

    • @ShanesCows
      @ShanesCows  Před 4 lety

      Not sure. I don’t make many PowerShell videos these days. 😐

  • @funhurtsmylungs1056
    @funhurtsmylungs1056 Před 7 lety

    Shane. Nice video, I also use Write-Host all the time when I want to know a value of a list item with SharePoint. Could you link to that article saying it's horrible to use?

    • @ShanesCows
      @ShanesCows  Před 7 lety +2

      community.idera.com/powershell/powershell_com_featured_blogs/b/donjones/posts/2012-scripting-games-commentary that is one place. If you search for it you can find a whole slew of articles that speak to the evils one way or another.

    • @funhurtsmylungs1056
      @funhurtsmylungs1056 Před 7 lety

      Thanks!

    • @bjoernf73
      @bjoernf73 Před 3 lety

      @@ShanesCows My impression too. I could never understand why people were so mad about a cmdlet that wouldn’t let them catch the output of it. In many cases, that’s a good thing.

  • @stephenbrincat7124
    @stephenbrincat7124 Před 6 lety

    Hi Shane, thanks for the interesting videos, not sure if my task can be done by PowerShell, I have an excel file connected with to a database via ODBC, which updates daily, now I'm looking for something automated that can run the excel file so data is updated and after be sent email to my boss on daily. Can Powreshell do such job?

    • @ShanesCows
      @ShanesCows  Před 6 lety

      +Stephen Brincat I had never thought about this before. A quick Bing left me with this that seems like it would get you started. If you try it let me know how it goes. social.msdn.microsoft.com/Forums/office/en-US/b1e0f499-173b-41ad-b61f-274bf3fb4901/excel-refresh-from-powershell?forum=exceldev

  • @krishnapurohit3494
    @krishnapurohit3494 Před 4 lety +1

    How to make bold-font in powershell?

    • @ShanesCows
      @ShanesCows  Před 4 lety

      I don’t think you can but never thought about it

    • @krishnapurohit3494
      @krishnapurohit3494 Před 4 lety

      @@ShanesCows yeah right, as of now, there's no way to fo it in powershell 5.

  • @dawnrazor
    @dawnrazor Před 3 lety +1

    I could never understand the vitriol about write-host. Don't be afraid and use it if you need to (damn those puppies and kittens!). Just understand why it's not suitable in some situations. If you want to write a console application which needs to present output, then there is no other option than to use Write-Host if you want to use colours to spice up the output

  • @PcGeek04
    @PcGeek04 Před 7 lety +1

    I used to think you were a relatively intelligent guy. Nope. Wasn't the first time I have been wrong! Hahahahah. All good fun brother.
    Output > host 4Eva
    Want color,
    Write-Verbose
    Write-Warning

    • @ShanesCows
      @ShanesCows  Před 7 lety

      +MrDonivan yeah. Getting a lot of poop for this one. But it is a necessary evil to discuss. Everyone else puts there head in the sand about it.

    • @PcGeek04
      @PcGeek04 Před 7 lety

      Shane Young I'm with ya hero. I argue Ford/Chevy style with a coworker quite often about the Write-Host. S Write-Output thing. I decided long ago to rid myself of the Write-Host burden.

  • @Tommy_007
    @Tommy_007 Před 2 lety +1

    I really like your videos. But please skip the LOUD intro.

    • @ShanesCows
      @ShanesCows  Před 2 lety +1

      Agreed Tommy! I learned this lesson with later videos. Sorry.

    • @Tommy_007
      @Tommy_007 Před 2 lety

      @@ShanesCows Don't worry, the sound could be a lot worse :-) I'll look forward to watching the rest of the videos.

  • @logicalnetwork1611
    @logicalnetwork1611 Před 2 lety +1

    Good tutorial. But music sucks.

    • @ShanesCows
      @ShanesCows  Před 2 lety

      Ageed. 😍 As I got better at this whole CZcams thing the music gets quieter and shorter and eventually completely replaced. The early content... you just kind of have to suffer. Sorry.