Search notes:

PowerShell cmdLet: Get-Random

By default, get-random returns a System.Int32 whose value is between 0 and [System.Int]::MaxValue.
The range of return values can be restricted:
PS> get-random -minimum 1000 -maximum 2000
1620
The PRG can be seeded:
PS> get-random -setSeed 42
381294397
PS> get-random
1003291822
Select n random elements from an array:
PS> get-random -count 3 ('one', 'two', 'three', 'four', 'five')
one
five
three
Powershell 7 - Randomly permutate an array:
PS> get-random -shuffle ('one', 'two', 'three', 'four', 'five')
three
one
five
four
two

See also

PowerShell 7.4 adds the cmdlet get-secureRandom.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1759384154, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/command-inventory/noun/random/get(64): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78