r/PowerShell • • Sep 12 '19

PowerShell All the Things

Post image
505 Upvotes

26 comments sorted by

View all comments

0

u/[deleted] Sep 12 '19

[deleted]

0

u/[deleted] Sep 13 '19

[deleted]

2

u/empty_other Sep 13 '19
1..999 | % { (1,0|Get-Random)} | Join-String

Random binary generator! :P

2

u/BlitzThunderWolf Nov 29 '19 edited Nov 29 '19

Wouldn't it be more efficient to use get-random without a pipe? Like: get-random 0,1

Edit: I tested it and was wrong

1

u/empty_other Nov 29 '19

You are right, your way is slightly faster on my system. Around 2% faster.

2

u/BlitzThunderWolf Nov 29 '19

Your way was faster on my system by like 100ms lol