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

Friday the 13th Fun

Posted on February 13, 2015May 13, 2022
friday the 13th

It is that time of year again. But instead of being freaked out by Friday the 13th, let's have a little fun. Here is a collection of PowerShell one-liners, all celebrating 13. And maybe you'll even pick up something new about PowerShell.

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!

Behind the PowerShell Pipeline
#13^13
[math]::Pow(13,13)

#get the 13 letter from [CHAR] equivalent
#arrays start counting at 0
(65..90).foreach({$_ -as [char]})[12]

#pad Friday to 13 spaces
"Friday".padleft(13,"!")

#get the 13th process
(get-process)[12]

#13!
(1..13 | measure -sum).sum

#get 13 random numbers between 13 and 1313
1..13 | foreach {Get-Random -min 13 -max 1313}

#create a 13 character random password
-join ((33..126).foreach({$_ -as [char]}) | get-random -Count 13)

#get date and time 13 days, 13 hours, 13 minutes and 13 seconds from now
(Get-Date).AddDays(13).AddHours(13).AddMinutes(13).AddSeconds(13)

#Adding it all up
13+13KB+13MB+13GB+13TB+13PB

#13 Fridays in a row
"Friday"*13

#13 Fridays in a column (array)
1..13 | foreach { "Friday" }

#Get the 13 most recent events in the System eventlog
get-eventlog system -Newest 13
# A PS7 version
get-winevent -logname system -MaxEvents 13

#don't go in the lake
start http://www.imdb.com/title/tt0080761/

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

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

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