Skip to content

Commit

Permalink
Fixes MicrosoftDocs#4515 Fixes MicrosoftDocs#4658 - fix example and s…
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwheeler authored and DCtheGeek committed Aug 20, 2019
1 parent 87ad294 commit cf766da
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 68 deletions.
23 changes: 13 additions & 10 deletions reference/3.0/Microsoft.PowerShell.Utility/Get-Random.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: Microsoft.PowerShell.Utility
ms.date: 02/26/2019
ms.date: 08/20/2019
online version: https://go.microsoft.com/fwlink/?linkid=113446
schema: 2.0.0
title: Get-Random
Expand Down Expand Up @@ -42,7 +42,7 @@ the number of objects returned from a submitted collection.

### Example 1: Get a random integer

This command gets a random integer between 0 (zero) and Int32.MaxValue.
This command gets a random integer between 0 (zero) and **Int32.MaxValue**.

```powershell
Get-Random
Expand Down Expand Up @@ -230,8 +230,10 @@ Name Count

### -Count

Specifies how many objects are returned. The default is 1. If the value of **Count** exceeds the
number of objects in the collection, `Get-Random` returns all of the objects in random order.
Specifies the number of random objects or numbers to return. The default is 1.

When used with `InputObject`, if the value of **Count** exceeds the number of objects in the
collection, `Get-Random` returns all of the objects in random order.

```yaml
Type: Int32
Expand Down Expand Up @@ -318,12 +320,13 @@ Accept wildcard characters: False

Specifies a seed value for the random number generator. This seed value is used for the current
command and for all subsequent `Get-Random` commands in the current session until you use
**SetSeed** again or close the session. You cannot reset the seed to its default, clock-based value.
**SetSeed** again or close the session. You cannot reset the seed to its default value.

The **SetSeed** parameter is not required. By default, `Get-Random` uses the system clock to
generate a seed value. Because **SetSeed** results in non-random behavior, it is typically used only
when trying to reproduce behavior, such as when debugging or analyzing a script that includes
`Get-Random` commands.
The **SetSeed** parameter is not required. By default, `Get-Random` uses the
[RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
method to generate a seed value. Because **SetSeed** results in non-random behavior, it is typically
used only when trying to reproduce behavior, such as when debugging or analyzing a script that
includes `Get-Random` commands.

```yaml
Type: Int32
Expand All @@ -341,7 +344,7 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
23 changes: 13 additions & 10 deletions reference/4.0/Microsoft.PowerShell.Utility/Get-Random.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: Microsoft.PowerShell.Utility
ms.date: 02/26/2019
ms.date: 08/20/2019
online version: https://go.microsoft.com/fwlink/?linkid=293974
schema: 2.0.0
title: Get-Random
Expand Down Expand Up @@ -42,7 +42,7 @@ the number of objects returned from a submitted collection.

### Example 1: Get a random integer

This command gets a random integer between 0 (zero) and Int32.MaxValue.
This command gets a random integer between 0 (zero) and **Int32.MaxValue**.

```powershell
Get-Random
Expand Down Expand Up @@ -230,8 +230,10 @@ Name Count

### -Count

Specifies how many objects are returned. The default is 1. If the value of **Count** exceeds the
number of objects in the collection, `Get-Random` returns all of the objects in random order.
Specifies the number of random objects or numbers to return. The default is 1.

When used with `InputObject`, if the value of **Count** exceeds the number of objects in the
collection, `Get-Random` returns all of the objects in random order.

```yaml
Type: Int32
Expand Down Expand Up @@ -318,12 +320,13 @@ Accept wildcard characters: False

Specifies a seed value for the random number generator. This seed value is used for the current
command and for all subsequent `Get-Random` commands in the current session until you use
**SetSeed** again or close the session. You cannot reset the seed to its default, clock-based value.
**SetSeed** again or close the session. You cannot reset the seed to its default value.

The **SetSeed** parameter is not required. By default, `Get-Random` uses the system clock to
generate a seed value. Because **SetSeed** results in non-random behavior, it is typically used only
when trying to reproduce behavior, such as when debugging or analyzing a script that includes
`Get-Random` commands.
The **SetSeed** parameter is not required. By default, `Get-Random` uses the
[RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
method to generate a seed value. Because **SetSeed** results in non-random behavior, it is typically
used only when trying to reproduce behavior, such as when debugging or analyzing a script that
includes `Get-Random` commands.

```yaml
Type: Int32
Expand All @@ -341,7 +344,7 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
23 changes: 13 additions & 10 deletions reference/5.0/Microsoft.PowerShell.Utility/Get-Random.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: Microsoft.PowerShell.Utility
ms.date: 02/26/2019
ms.date: 08/20/2019
online version: https://go.microsoft.com/fwlink/?linkid=821799
schema: 2.0.0
title: Get-Random
Expand Down Expand Up @@ -42,7 +42,7 @@ the number of objects returned from a submitted collection.

### Example 1: Get a random integer

This command gets a random integer between 0 (zero) and Int32.MaxValue.
This command gets a random integer between 0 (zero) and **Int32.MaxValue**.

```powershell
Get-Random
Expand Down Expand Up @@ -230,8 +230,10 @@ Name Count

### -Count

Specifies how many objects are returned. The default is 1. If the value of **Count** exceeds the
number of objects in the collection, `Get-Random` returns all of the objects in random order.
Specifies the number of random objects or numbers to return. The default is 1.

When used with `InputObject`, if the value of **Count** exceeds the number of objects in the
collection, `Get-Random` returns all of the objects in random order.

```yaml
Type: Int32
Expand Down Expand Up @@ -318,12 +320,13 @@ Accept wildcard characters: False

Specifies a seed value for the random number generator. This seed value is used for the current
command and for all subsequent `Get-Random` commands in the current session until you use
**SetSeed** again or close the session. You cannot reset the seed to its default, clock-based value.
**SetSeed** again or close the session. You cannot reset the seed to its default value.

The **SetSeed** parameter is not required. By default, `Get-Random` uses the system clock to
generate a seed value. Because **SetSeed** results in non-random behavior, it is typically used only
when trying to reproduce behavior, such as when debugging or analyzing a script that includes
`Get-Random` commands.
The **SetSeed** parameter is not required. By default, `Get-Random` uses the
[RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
method to generate a seed value. Because **SetSeed** results in non-random behavior, it is typically
used only when trying to reproduce behavior, such as when debugging or analyzing a script that
includes `Get-Random` commands.

```yaml
Type: Int32
Expand All @@ -341,7 +344,7 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
23 changes: 13 additions & 10 deletions reference/5.1/Microsoft.PowerShell.Utility/Get-Random.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: Microsoft.PowerShell.Utility
ms.date: 02/26/2019
ms.date: 08/20/2019
online version: https://go.microsoft.com/fwlink/?linkid=821799
schema: 2.0.0
title: Get-Random
Expand Down Expand Up @@ -42,7 +42,7 @@ the number of objects returned from a submitted collection.

### Example 1: Get a random integer

This command gets a random integer between 0 (zero) and Int32.MaxValue.
This command gets a random integer between 0 (zero) and **Int32.MaxValue**.

```powershell
Get-Random
Expand Down Expand Up @@ -230,8 +230,10 @@ Name Count

### -Count

Specifies how many objects are returned. The default is 1. If the value of **Count** exceeds the
number of objects in the collection, `Get-Random` returns all of the objects in random order.
Specifies the number of random objects or numbers to return. The default is 1.

When used with `InputObject`, if the value of **Count** exceeds the number of objects in the
collection, `Get-Random` returns all of the objects in random order.

```yaml
Type: Int32
Expand Down Expand Up @@ -318,12 +320,13 @@ Accept wildcard characters: False

Specifies a seed value for the random number generator. This seed value is used for the current
command and for all subsequent `Get-Random` commands in the current session until you use
**SetSeed** again or close the session. You cannot reset the seed to its default, clock-based value.
**SetSeed** again or close the session. You cannot reset the seed to its default value.

The **SetSeed** parameter is not required. By default, `Get-Random` uses the system clock to
generate a seed value. Because **SetSeed** results in non-random behavior, it is typically used only
when trying to reproduce behavior, such as when debugging or analyzing a script that includes
`Get-Random` commands.
The **SetSeed** parameter is not required. By default, `Get-Random` uses the
[RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
method to generate a seed value. Because **SetSeed** results in non-random behavior, it is typically
used only when trying to reproduce behavior, such as when debugging or analyzing a script that
includes `Get-Random` commands.

```yaml
Type: Int32
Expand All @@ -341,7 +344,7 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
35 changes: 21 additions & 14 deletions reference/6/Microsoft.PowerShell.Utility/Get-Random.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: Microsoft.PowerShell.Utility
ms.date: 02/26/2019
ms.date: 08/20/2019
online version: https://go.microsoft.com/fwlink/?linkid=2096427
schema: 2.0.0
title: Get-Random
Expand Down Expand Up @@ -42,7 +42,7 @@ the number of objects returned from a submitted collection.

### Example 1: Get a random integer

This command gets a random integer between 0 (zero) and Int32.MaxValue.
This command gets a random integer between 0 (zero) and **Int32.MaxValue**.

```powershell
Get-Random
Expand Down Expand Up @@ -229,16 +229,22 @@ Name Count
### Example 12: Use the Count parameter

You can now use the **Count** parameter without piping objects to `Get-Random`. The following
example gets three random numbers less than 10.
example gets three random files from an object containing files.

```powershell
Get-Random -Maximum 10 -Count 3
$files = dir C:\Windows\System32
Get-Random -Count 3 -InputObject $files
```

```Output
8
8
3
Directory: C:\Windows\System32
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---l 9/15/2018 12:28 AM 11264 spmpm.dll
-a---l 3/12/2019 4:52 PM 489984 ResourceMapper.dll
-a---- 7/16/2016 7:28 AM 70656 UpgradeSubscription.exe
```

## PARAMETERS
Expand All @@ -252,7 +258,7 @@ collection, `Get-Random` returns all of the objects in random order.

```yaml
Type: Int32
Parameter Sets:
Parameter Sets: RandomListItemParameterSet
Aliases:

Required: False
Expand Down Expand Up @@ -335,12 +341,13 @@ Accept wildcard characters: False

Specifies a seed value for the random number generator. This seed value is used for the current
command and for all subsequent `Get-Random` commands in the current session until you use
**SetSeed** again or close the session. You cannot reset the seed to its default, clock-based value.
**SetSeed** again or close the session. You cannot reset the seed to its default value.

The **SetSeed** parameter is not required. By default, `Get-Random` uses the system clock to
generate a seed value. Because **SetSeed** results in non-random behavior, it is typically used only
when trying to reproduce behavior, such as when debugging or analyzing a script that includes
`Get-Random` commands.
The **SetSeed** parameter is not required. By default, `Get-Random` uses the
[RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
method to generate a seed value. Because **SetSeed** results in non-random behavior, it is typically
used only when trying to reproduce behavior, such as when debugging or analyzing a script that
includes `Get-Random` commands.

```yaml
Type: Int32
Expand All @@ -358,7 +365,7 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
Loading

0 comments on commit cf766da

Please sign in to comment.