Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

A PowerShell New Year

Posted on December 31, 2015December 30, 2015

Champagne_glasses

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

First off, let me thank all of you for your support and interest in my work this past year. Without it I'd be another old man sitting in his bathrobe talking to himself. I hope I can keep your interest in 2016.

To wrap up the year and to bring in the new, i have a final PowerShell gift for you.  I've started to use GitHub to host the scripts and projects I share on my blog.  Although you can also copy and paste the code from here.

Normally, I would post a screen shot but that will take away all of the fun. Hopefully you trust me. Save the script, open a PowerShell prompt in the console (not the ISE) and run it.

I hope you, your family, friends and colleagues have a wonderful 2016.

Cheers!


Behind the PowerShell Pipeline

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

8 thoughts on “A PowerShell New Year”

  1. Ev says:
    December 31, 2015 at 3:41 pm

    #this must be run in the PowerShell console NOT the ISE
    if ($host.name -ne ‘ConsoleHost’) {
    Write-Warning “Sorry. This must be run in the PowerShell console.”
    #bail out
    Return
    }

    #get window dimensions
    $X = $host.ui.RawUI.WindowSize.width
    #subtract 5 to accomodate the end of the script
    $Y = $host.ui.RawUI.WindowSize.Height – 5

    #save current window title
    $title = $host.ui.RawUI.WindowTitle

    #get an array of console colors
    $colors = [enum]::GetNames([consolecolor])

    #
    Add-Type -AssemblyName System.speech
    $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
    $speak.SelectVoice(‘Microsoft Zira Desktop’)

    #clear the screen
    cls
    #for every line of window height counting down
    $Y..1 | Foreach {
    #write a randomized colored row
    1..$X | foreach {
    Write-Host ” ” -BackgroundColor (Get-Random $colors) -NoNewline
    }
    #count down the last 10
    if ($_ -le 10) {
    $host.ui.RawUI.WindowTitle = $_
    $speak.Speak($_)
    #[console]::Beep()
    #Start-Sleep -Milliseconds 500
    }
    }
    $speak.Speak(‘Happy New Year!’)
    $msg = “Happy New Year!”

    $msg.ToCharArray() | foreach -Begin {Write-Host “`n”} -process {
    Write-Host $_ -NoNewline -ForegroundColor (Get-Random $colors) -BackgroundColor (Get-Random $colors)
    } -end { Write-Host “`n” }

    #reset the window Title
    $host.ui.RawUI.WindowTitle = $Title

    1. Jeffery Hicks says:
      December 31, 2015 at 5:18 pm

      Oh that’s fun. Thanks.

  2. Garth Aurish says:
    January 2, 2016 at 7:09 am

    Happy new year Jeffrey,

    Really appreciate everything you do in furthering everyone’s knowledge on powershell.

    Yourself and Don have greatly enhanced my career and love for automation.

    Keep up the great work

  3. Graham Beer says:
    January 2, 2016 at 9:06 am

    Awesome Jeff ! How on earth do you go about finding out this stuff ?! You’re a PowerShell genius !

    1. Jeffery Hicks says:
      January 2, 2016 at 11:49 am

      I read the help documents and use tools like Get-Member to explore.

      1. graham beer says:
        January 3, 2016 at 8:12 am

        Thanks Jeff, really useful to know. Would you say PowerShell is easy to master out of the other scripting languages?

      2. Jeffery Hicks says:
        January 3, 2016 at 2:08 pm

        I would think so. Definitely easier than VBScript. There are consistent naming conventions. Command names are plain. It is pretty clear what Stop-Service is going to do. Scripting syntax elements like If and Do are easier to learn. But it is like a foreign language which means the only way you gain proficiency is by using it every day.

  4. Graham Beer says:
    January 3, 2016 at 4:44 pm

    Many Thanks Jeff.

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2026 The Lonely Administrator | Powered by SuperbThemes!
%d