September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,31 @@
function Get-RandomInteger
{
Param
(
[Parameter(Mandatory=$false,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
[ValidateScript({$_ -ge 4})]
[int[]]
$InputObject = 64
)
Begin
{
$rng = New-Object -TypeName System.Security.Cryptography.RNGCryptoServiceProvider
}
Process
{
foreach($count in $InputObject)
{
$bytes = New-Object -TypeName Byte[] -Argument $count
$rng.GetBytes($bytes)
[System.BitConverter]::ToInt32($bytes,0)
}
}
End
{
Remove-Variable -Name rng -Scope Local
}
}

View file

@ -0,0 +1 @@
4,8,16,32,64,128 | Get-RandomInteger | Format-Wide {$_} -Column 6 -Force

View file

@ -0,0 +1 @@
4,8,16,32,64,128 | Get-RandomInteger | Format-Wide {"0x{0:X}" -f $_} -Column 6 -Force