Updates from: 02/05/2021 04:15:26
Service Microsoft Docs article Related commit history on GitHub Change details
Microsoft.PowerShell.Core https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/Wait-Job?view=powershell-5.1 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/Wait-Job.md
@@ -3,7 +3,7 @@ external help file: System.Management.Automation.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 06/09/2017 Last updated : 01/28/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/wait-job?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Wait-Job
@@ -11,8 +11,7 @@ Title: Wait-Job
# Wait-Job ## SYNOPSIS
-Suppresses the command prompt until one or all of the PowerShell background jobs running in
-the session are completed.
+Waits until one or all of the PowerShell jobs running in the session are in a terminating state.
## SYNTAX
@@ -54,16 +53,23 @@ Wait-Job [-Any] [-Timeout <Int32>] [-Force] [-Filter] <Hashtable> [<CommonParame
## DESCRIPTION
-The `Wait-Job` cmdlet waits for Windows PowerShell background jobs to finish before it displays the
-command prompt. You can wait until any background job is complete, or until all background jobs are
-complete, and you can set a maximum wait time for the job.
+The `Wait-Job` cmdlet waits for a job to be in a terminating state before continuing execution.
+The terminating states are:
-When the commands in the job are complete, `Wait-Job` displays the command prompt and returns a job
-object so that you can pipe it to another command.
+- Completed
+- Failed
+- Stopped
+- Suspended
+- Disconnected
-You can use `Wait-Job` cmdlet to wait for background jobs, such as those that were started by using
-the `Start-Job` cmdlet or the **AsJob** parameter of the `Invoke-Command` cmdlet. For more
-information about Windows PowerShell background jobs, see [about_Jobs](./about/about_Jobs.md).
+You can wait until a specified job, or all jobs are in a terminating state. You can also set a
+maximum wait time for the job using the **Timeout** parameter, or use the **Force** parameter to
+wait for a job in the `Suspended` or `Disconnected` states.
+
+When the commands in the job are complete, `Wait-Job` returns a job object and continues execution.
+
+You can use the `Wait-Job` cmdlet to wait for jobs started by using the `Start-Job` cmdlet or the
+**AsJob** parameter of the `Invoke-Command` cmdlet. For more information about jobs, see [about_Jobs](./about/about_Jobs.md).
Starting in Windows PowerShell 3.0, the `Wait-Job` cmdlet also waits for custom job types, such as workflow jobs and instances of scheduled jobs. To enable `Wait-Job` to wait for jobs of a particular
@@ -80,7 +86,7 @@ type feature.
Get-Job | Wait-Job ```
-This command waits for all of the background jobs running in the session to finish.
+This command waits for all of the jobs running in the session to finish.
### Example 2: Wait for jobs started on remote computers by using Start-Job
@@ -99,7 +105,7 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on remote
the `Start-Job` cmdlet. Both `Start-Job` and `Wait-Job` commands are submitted to the remote computer by using the `Invoke-Command` cmdlet.
-This example uses `Wait-Job` to determine whether a `Get-Date` command running as a background job
+This example uses `Wait-Job` to determine whether a `Get-Date` command running as a job
on three different computers is finished. The first command creates a Windows PowerShell session (**PSSession**) on each of the three remote
@@ -108,14 +114,14 @@ computers and stores them in the `$s` variable.
The second command uses `Invoke-Command` to run `Start-Job` in each of the three sessions in `$s`. All of the jobs are named Date1.
-The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the Date1 jobs on
-each computer to finish. It stores the resulting collection (array) of job objects in the `$done`
-variable.
+The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the `Date1` jobs
+on each computer to finish. It stores the resulting collection (**array**) of **job** objects in the
+`$done` variable.
The fourth command uses the **Count** property of the array of job objects in the `$done` variable to determine how many of the jobs are finished.
-### Example 3: Determine when the first background job finishes
+### Example 3: Determine when the first job finishes
```powershell $s = New-PSSession (Get-Content Machines.txt)
@@ -124,9 +130,9 @@ Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {$Using:c}
Invoke-Command -Session $s -ScriptBlock {Wait-Job -Any} ```
-This example uses the **Any** parameter of `Wait-Job` to determine when the first of many background
-jobs running in the current session are completed. It also shows how to use the `Wait-Job` cmdlet to
-wait for remote jobs to finish.
+This example uses the **Any** parameter of `Wait-Job` to determine when the first of many jobs
+running in the current session are in a terminating state. It also shows how to use the `Wait-Job`
+cmdlet to wait for remote jobs to finish.
The first command creates a **PSSession** on each of the computers listed in the Machines.txt file and stores the **PSSession** objects in the `$s` variable. The command uses the `Get-Content` cmdlet
@@ -136,7 +142,7 @@ that it runs before the `New-PSSession` command.
The second command stores a `Get-EventLog` command string, in quotation marks, in the `$c` variable. The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the sessions in `$s`.
-The `Start-Job` command starts a background job that runs the `Get-EventLog` command in the `$c`
+The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c`
variable. The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the
@@ -145,14 +151,15 @@ information about the **Using** scope modifier, see
[about_Remote_Variables](./about/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the
-**Any** parameter to wait until the first job on the remote computers is completed.
+**Any** parameter to wait until the first job on the remote computers is terminating state.
### Example 4: Set a wait time for jobs on remote computers ```powershell
-$s = New-PSSession Server01, Server02, Server03
-$jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
-$done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS> $s = New-PSSession Server01, Server02, Server03
+PS> $jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
+PS> $done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS>
``` This example shows how to use the **Timeout** parameter of `Wait-Job` to set a maximum wait time for
@@ -170,8 +177,8 @@ the **Timeout** parameter with a value of 30 to establish the maximum wait time,
results of the command in the `$done` variable. In this case, after 30 seconds, only the command on the Server02 computer has completed. `Wait-Job`
-ends the wait, displays the command prompt, and returns the object that represents the job that was
-completed.
+ends the wait, returns the object that represents the job that was
+completed, and displays the command prompt.
The `$done` variable contains a job object that represents the job that ran on Server02.
@@ -181,8 +188,8 @@ The `$done` variable contains a job object that represents the job that ran on S
Wait-Job -id 1,2,5 -Any ```
-This command identifies three jobs by their IDs and waits until any one of them are completed.
-The command prompt returns when the first job finishes.
+This command identifies three jobs by their IDs and waits until any one of them are in a terminating
+state. Execution continues when the first job finishes.
### Example 6: Wait for a period, then allow job to continue in background
@@ -191,7 +198,7 @@ Wait-Job -Name "DailyLog" -Timeout 120
``` This command waits 120 seconds (two minutes) for the DailyLog job to finish. If the job does not
-finish in the next two minutes, the command prompt returns anyway, and the job continues to run in
+finish in the next two minutes, execution continues, and the job continues to run in
the background. ### Example 7: Wait for a job by name
@@ -205,7 +212,7 @@ This command uses the job name to identify the job for which to wait.
### Example 8: Wait for jobs on local computer started with Start-Job ```powershell
-$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
+$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_.lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
$j | Wait-Job ```
@@ -215,12 +222,12 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on the loc
These commands start a job that gets the Windows PowerShell script files that were added or updated in the last week.
-The first command uses `Start-Job` to start a background job on the local computer. The job runs a
+The first command uses `Start-Job` to start a job on the local computer. The job runs a
`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were added or updated in the last week.
-The third command uses `Wait-Job` to wait until the job is completed. When the job finishes, the
-command displays the job object, which contains information about the job.
+The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job
+finishes, the command displays the job object, which contains information about the job.
### Example 9: Wait for jobs started on remote computers by using Invoke-Command
@@ -236,15 +243,15 @@ computer and the results are automatically returned to the local computer, even
on the remote computers. This example uses `Wait-Job` to determine whether a `Get-Process` command running in the sessions on
-three remote computers is completed.
+three remote computers is in a terminating state.
The first command creates **PSSession** objects on three computers and stores them in the `$s` variable. The second command uses `Invoke-Command` to run `Get-Process` in each of the three sessions in `$s`.
-The command uses the **AsJob** parameter to run the command asynchronously as a background job. The
-command returns a job object, just like the jobs started by using `Start-Job`, and the job object is
-stored in the `$j` variable.
+The command uses the **AsJob** parameter to run the command asynchronously as a job. The command
+returns a job object, just like the jobs started by using `Start-Job`, and the job object is stored
+in the `$j` variable.
The third command uses a pipeline operator (`|`) to send the job object in `$j` to the `Wait-Job` cmdlet. An `Invoke-Command` command is not required in this case, because the job resides on the
@@ -273,9 +280,9 @@ This command waits for the job with an ID value of 1.
### -Any
-Indicates that this cmdlet displays the command prompt, and returns the job object, when any job
-finishes. By default, `Wait-Job` waits until all of the specified jobs are complete before it
-displays the prompt.
+Indicates that this cmdlet returns the job object and continues execution when any job finishes. By
+default, `Wait-Job` waits until all of the specified jobs are complete before it displays the
+prompt.
```yaml Type: System.Management.Automation.SwitchParameter
@@ -296,8 +303,8 @@ in the hash table. Enter a hash table where the keys are job properties and the
property values. This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not
-work on standard background jobs, such as those created by using the `Start-Job` cmdlet. For
-information about support for this parameter, see the help topic for the job type.
+work on standard jobs, such as those created by using the `Start-Job` cmdlet. For information about
+support for this parameter, see the help topic for the job type.
This parameter was introduced in Windows PowerShell 3.0.
@@ -445,12 +452,12 @@ Accept wildcard characters: False
### -Timeout
-Specifies the maximum wait time for each background job, in seconds. The default value, -1,
-indicates that the cmdlet waits until the job finishes. The timing starts when you submit the
-`Wait-Job` command, not the `Start-Job` command.
+Specifies the maximum wait time for each job, in seconds. The default value, -1, indicates that the
+cmdlet waits until the job finishes. The timing starts when you submit the `Wait-Job` command, not
+the `Start-Job` command.
-If this time is exceeded, the wait ends and the command prompt returns, even if the job is still
-running. The command does not display any error message.
+If this time is exceeded, the wait ends and execution continues, even if the job is still running.
+The command does not display any error message.
```yaml Type: System.Int32
@@ -481,8 +488,8 @@ You can pipe a job object to this cmdlet.
### System.Management.Automation.PSRemotingJob
-This cmdlet returns job objects that represent the completed jobs. If the wait ends because the
-value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
+This cmdlet returns job objects that represent the jobs in a terminating state. If the wait ends
+because the value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
## NOTES
Microsoft.PowerShell.Management https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Clear-RecycleBin?view=powershell-5.1 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Management/Clear-RecycleBin.md
@@ -1,9 +1,8 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
-keywords: powershell,cmdlet
Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 6/24/2019 Last updated : 01/29/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Clear-RecycleBin
@@ -91,7 +90,8 @@ Accept wildcard characters: False
### -Force
-Specifies that the user isn't prompted for confirmation to clear a recycle bin.
+Specifies that the user isn't prompted for confirmation to clear a recycle bin. The **Force**
+parameter also overrides the **WhatIf** and **Confirm** parameters.
```yaml Type: System.Management.Automation.SwitchParameter
Microsoft.PowerShell.Utility https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Get-Random?view=powershell-5.1 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Utility/Get-Random.md
@@ -1,9 +1,8 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
-keywords: powershell,cmdlet
Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 04/08/2020 Last updated : 02/02/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-random?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-Random
@@ -35,8 +34,20 @@ The `Get-Random` cmdlet gets a randomly selected number. If you submit a collect
Without parameters or input, a `Get-Random` command returns a randomly selected 32-bit unsigned integer between 0 (zero) and **Int32.MaxValue** (`0x7FFFFFFF`, `2,147,483,647`).
-You can use the parameters of `Get-Random` to specify a seed number, minimum and maximum values, and
-the number of objects returned from a submitted collection.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
+
+You can use the parameters of `Get-Random` to specify the minimum and maximum values, the number of
+objects returned from a collection, or a seed number.
+
+> [!CAUTION]
+> Setting the seed deliberately results in non-random, repeatable behavior. It should only be used
+> when trying to reproduce behavior, such as when debugging or analyzing a script that includes
+> `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
## EXAMPLES
@@ -205,9 +216,9 @@ $Sample = $Files | Get-Random -Count 50
### Example 11: Roll fair dice
-This example rolls a fair die 1200 times and counts the outcomes. The first command, `ForEach-Object`
-repeats the call to `Get-Random` from the piped in numbers (1-6). The results are grouped by their
-value with `Group-Object` and formatted as a table with `Select-Object`.
+This example rolls a fair die 1200 times and counts the outcomes. The first command,
+`ForEach-Object` repeats the call to `Get-Random` from the piped in numbers (1-6). The results are
+grouped by their value with `Group-Object` and formatted as a table with `Select-Object`.
```powershell 1..1200 | ForEach-Object {
@@ -318,15 +329,17 @@ Accept wildcard characters: False
### -SetSeed
-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 can't reset the seed to its default value.
+Specifies a seed value for the random number generator. When you use **SetSeed**, the cmdlet uses
+the [System.Random](/dotnet/api/system.random) method to generate pseudorandom numbers, which is not
+cryptographically secure.
-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's typically
-used only when trying to reproduce behavior, such as when debugging or analyzing a script that
-includes `Get-Random` commands.
+> [!CAUTION]
+> Setting the seed results in non-random behavior. It should only be used when trying to reproduce
+> behavior, such as when debugging or analyzing a script that includes `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
```yaml Type: System.Nullable`1[System.Int32]
@@ -344,7 +357,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216).
+-WarningAction, and -WarningVariable. For more information, see
+[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -361,8 +375,8 @@ submitted collection.
## NOTES
-`Get-Random` sets a default seed for each session based on the system time clock when the session
-starts.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
`Get-Random` does not alway return the same data type as the input value. The following table shows the output type for each of the numeric input types.
@@ -384,3 +398,7 @@ Beginning in Windows PowerShell 3.0, `Get-Random` supports 64-bit integers. In W
2.0, all values are cast to **System.Int32**. ## RELATED LINKS+
+[System.Security.Cryptography.RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
+
+[Sytem.Random](/dotnet/api/system.random)
Microsoft.PowerShell.Core https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/Wait-Job?view=powershell-7.0 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/Wait-Job.md
@@ -3,7 +3,7 @@ external help file: System.Management.Automation.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 06/09/2017 Last updated : 01/28/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/wait-job?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Wait-Job
@@ -11,8 +11,7 @@ Title: Wait-Job
# Wait-Job ## SYNOPSIS
-Suppresses the command prompt until one or all of the PowerShell background jobs running in
-the session are completed.
+Waits until one or all of the PowerShell jobs running in the session are in a terminating state.
## SYNTAX
@@ -54,16 +53,23 @@ Wait-Job [-Any] [-Timeout <Int32>] [-Force] [-Filter] <Hashtable> [<CommonParame
## DESCRIPTION
-The `Wait-Job` cmdlet waits for PowerShell background jobs to finish before it displays the
-command prompt. You can wait until any background job is complete, or until all background jobs are
-complete, and you can set a maximum wait time for the job.
+The `Wait-Job` cmdlet waits for a job to be in a terminating state before continuing execution.
+The terminating states are:
-When the commands in the job are complete, `Wait-Job` displays the command prompt and returns a job
-object so that you can pipe it to another command.
+- Completed
+- Failed
+- Stopped
+- Suspended
+- Disconnected
-You can use `Wait-Job` cmdlet to wait for background jobs, such as those that were started by using
-the `Start-Job` cmdlet or the **AsJob** parameter of the `Invoke-Command` cmdlet. For more
-information about Windows PowerShell background jobs, see [about_Jobs](./about/about_Jobs.md).
+You can wait until a specified job, or all jobs are in a terminating state. You can also set a
+maximum wait time for the job using the **Timeout** parameter, or use the **Force** parameter to
+wait for a job in the `Suspended` or `Disconnected` states.
+
+When the commands in the job are complete, `Wait-Job` returns a job object and continues execution.
+
+You can use the `Wait-Job` cmdlet to wait for jobs started by using the `Start-Job` cmdlet or the
+**AsJob** parameter of the `Invoke-Command` cmdlet. For more information about jobs, see [about_Jobs](./about/about_Jobs.md).
Starting in Windows PowerShell 3.0, the `Wait-Job` cmdlet also waits for custom job types, such as workflow jobs and instances of scheduled jobs. To enable `Wait-Job` to wait for jobs of a particular
@@ -80,7 +86,7 @@ type feature.
Get-Job | Wait-Job ```
-This command waits for all of the background jobs running in the session to finish.
+This command waits for all of the jobs running in the session to finish.
### Example 2: Wait for jobs started on remote computers by using Start-Job
@@ -99,7 +105,7 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on remote
the `Start-Job` cmdlet. Both `Start-Job` and `Wait-Job` commands are submitted to the remote computer by using the `Invoke-Command` cmdlet.
-This example uses `Wait-Job` to determine whether a `Get-Date` command running as a background job
+This example uses `Wait-Job` to determine whether a `Get-Date` command running as a job
on three different computers is finished. The first command creates a Windows PowerShell session (**PSSession**) on each of the three remote
@@ -108,14 +114,14 @@ computers and stores them in the `$s` variable.
The second command uses `Invoke-Command` to run `Start-Job` in each of the three sessions in `$s`. All of the jobs are named Date1.
-The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the Date1 jobs on
-each computer to finish. It stores the resulting collection (array) of job objects in the `$done`
-variable.
+The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the `Date1` jobs
+on each computer to finish. It stores the resulting collection (**array**) of **job** objects in the
+`$done` variable.
The fourth command uses the **Count** property of the array of job objects in the `$done` variable to determine how many of the jobs are finished.
-### Example 3: Determine when the first background job finishes
+### Example 3: Determine when the first job finishes
```powershell $s = New-PSSession (Get-Content Machines.txt)
@@ -124,9 +130,9 @@ Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {$Using:c}
Invoke-Command -Session $s -ScriptBlock {Wait-Job -Any} ```
-This example uses the **Any** parameter of `Wait-Job` to determine when the first of many background
-jobs running in the current session are completed. It also shows how to use the `Wait-Job` cmdlet to
-wait for remote jobs to finish.
+This example uses the **Any** parameter of `Wait-Job` to determine when the first of many jobs
+running in the current session are in a terminating state. It also shows how to use the `Wait-Job`
+cmdlet to wait for remote jobs to finish.
The first command creates a **PSSession** on each of the computers listed in the Machines.txt file and stores the **PSSession** objects in the `$s` variable. The command uses the `Get-Content` cmdlet
@@ -136,7 +142,7 @@ that it runs before the `New-PSSession` command.
The second command stores a `Get-EventLog` command string, in quotation marks, in the `$c` variable. The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the sessions in `$s`.
-The `Start-Job` command starts a background job that runs the `Get-EventLog` command in the `$c`
+The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c`
variable. The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the
@@ -145,14 +151,15 @@ information about the **Using** scope modifier, see
[about_Remote_Variables](./about/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the
-**Any** parameter to wait until the first job on the remote computers is completed.
+**Any** parameter to wait until the first job on the remote computers is terminating state.
### Example 4: Set a wait time for jobs on remote computers ```powershell
-$s = New-PSSession Server01, Server02, Server03
-$jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
-$done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS> $s = New-PSSession Server01, Server02, Server03
+PS> $jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
+PS> $done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS>
``` This example shows how to use the **Timeout** parameter of `Wait-Job` to set a maximum wait time for
@@ -170,8 +177,8 @@ the **Timeout** parameter with a value of 30 to establish the maximum wait time,
results of the command in the `$done` variable. In this case, after 30 seconds, only the command on the Server02 computer has completed. `Wait-Job`
-ends the wait, displays the command prompt, and returns the object that represents the job that was
-completed.
+ends the wait, returns the object that represents the job that was
+completed, and displays the command prompt.
The `$done` variable contains a job object that represents the job that ran on Server02.
@@ -181,8 +188,8 @@ The `$done` variable contains a job object that represents the job that ran on S
Wait-Job -id 1,2,5 -Any ```
-This command identifies three jobs by their IDs and waits until any one of them are completed.
-The command prompt returns when the first job finishes.
+This command identifies three jobs by their IDs and waits until any one of them are in a terminating
+state. Execution continues when the first job finishes.
### Example 6: Wait for a period, then allow job to continue in background
@@ -191,7 +198,7 @@ Wait-Job -Name "DailyLog" -Timeout 120
``` This command waits 120 seconds (two minutes) for the DailyLog job to finish. If the job does not
-finish in the next two minutes, the command prompt returns anyway, and the job continues to run in
+finish in the next two minutes, execution continues, and the job continues to run in
the background. ### Example 7: Wait for a job by name
@@ -205,7 +212,7 @@ This command uses the job name to identify the job for which to wait.
### Example 8: Wait for jobs on local computer started with Start-Job ```powershell
-$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
+$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_.lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
$j | Wait-Job ```
@@ -215,12 +222,12 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on the loc
These commands start a job that gets the Windows PowerShell script files that were added or updated in the last week.
-The first command uses `Start-Job` to start a background job on the local computer. The job runs a
+The first command uses `Start-Job` to start a job on the local computer. The job runs a
`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were added or updated in the last week.
-The third command uses `Wait-Job` to wait until the job is completed. When the job finishes, the
-command displays the job object, which contains information about the job.
+The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job
+finishes, the command displays the job object, which contains information about the job.
### Example 9: Wait for jobs started on remote computers by using Invoke-Command
@@ -236,15 +243,15 @@ computer and the results are automatically returned to the local computer, even
on the remote computers. This example uses `Wait-Job` to determine whether a `Get-Process` command running in the sessions on
-three remote computers is completed.
+three remote computers is in a terminating state.
The first command creates **PSSession** objects on three computers and stores them in the `$s` variable. The second command uses `Invoke-Command` to run `Get-Process` in each of the three sessions in `$s`.
-The command uses the **AsJob** parameter to run the command asynchronously as a background job. The
-command returns a job object, just like the jobs started by using `Start-Job`, and the job object is
-stored in the `$j` variable.
+The command uses the **AsJob** parameter to run the command asynchronously as a job. The command
+returns a job object, just like the jobs started by using `Start-Job`, and the job object is stored
+in the `$j` variable.
The third command uses a pipeline operator (`|`) to send the job object in `$j` to the `Wait-Job` cmdlet. An `Invoke-Command` command is not required in this case, because the job resides on the
@@ -273,9 +280,9 @@ This command waits for the job with an ID value of 1.
### -Any
-Indicates that this cmdlet displays the command prompt, and returns the job object, when any job
-finishes. By default, `Wait-Job` waits until all of the specified jobs are complete before it
-displays the prompt.
+Indicates that this cmdlet returns the job object and continues execution when any job finishes. By
+default, `Wait-Job` waits until all of the specified jobs are complete before it displays the
+prompt.
```yaml Type: System.Management.Automation.SwitchParameter
@@ -296,8 +303,8 @@ in the hash table. Enter a hash table where the keys are job properties and the
property values. This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not
-work on standard background jobs, such as those created by using the `Start-Job` cmdlet. For
-information about support for this parameter, see the help topic for the job type.
+work on standard jobs, such as those created by using the `Start-Job` cmdlet. For information about
+support for this parameter, see the help topic for the job type.
This parameter was introduced in Windows PowerShell 3.0.
@@ -445,12 +452,12 @@ Accept wildcard characters: False
### -Timeout
-Specifies the maximum wait time for each background job, in seconds. The default value, -1,
-indicates that the cmdlet waits until the job finishes. The timing starts when you submit the
-`Wait-Job` command, not the `Start-Job` command.
+Specifies the maximum wait time for each job, in seconds. The default value, -1, indicates that the
+cmdlet waits until the job finishes. The timing starts when you submit the `Wait-Job` command, not
+the `Start-Job` command.
-If this time is exceeded, the wait ends and the command prompt returns, even if the job is still
-running. The command does not display any error message.
+If this time is exceeded, the wait ends and execution continues, even if the job is still running.
+The command does not display any error message.
```yaml Type: System.Int32
@@ -481,8 +488,8 @@ You can pipe a job object to this cmdlet.
### System.Management.Automation.PSRemotingJob
-This cmdlet returns job objects that represent the completed jobs. If the wait ends because the
-value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
+This cmdlet returns job objects that represent the jobs in a terminating state. If the wait ends
+because the value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
## NOTES
Microsoft.PowerShell.Management https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Clear-RecycleBin?view=powershell-7.0 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Management/Clear-RecycleBin.md
@@ -1,9 +1,8 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
-keywords: powershell,cmdlet
Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 10/28/2019 Last updated : 01/29/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Clear-RecycleBin
@@ -93,7 +92,8 @@ Accept wildcard characters: False
### -Force
-Specifies that the user isn't prompted for confirmation to clear a recycle bin.
+Specifies that the user isn't prompted for confirmation to clear a recycle bin. The **Force**
+parameter also overrides the **WhatIf** and **Confirm** parameters.
```yaml Type: System.Management.Automation.SwitchParameter
Microsoft.PowerShell.Utility https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Get-Random?view=powershell-7.0 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Utility/Get-Random.md
@@ -1,9 +1,8 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
-keywords: powershell,cmdlet
Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 04/08/2020 Last updated : 02/02/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-random?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-Random
@@ -35,8 +34,20 @@ The `Get-Random` cmdlet gets a randomly selected number. If you submit a collect
Without parameters or input, a `Get-Random` command returns a randomly selected 32-bit unsigned integer between 0 (zero) and **Int32.MaxValue** (`0x7FFFFFFF`, `2,147,483,647`).
-You can use the parameters of `Get-Random` to specify a seed number, minimum and maximum values, and
-the number of objects returned from a submitted collection.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
+
+You can use the parameters of `Get-Random` to specify the minimum and maximum values, the number of
+objects returned from a collection, or a seed number.
+
+> [!CAUTION]
+> Setting the seed deliberately results in non-random, repeatable behavior. It should only be used
+> when trying to reproduce behavior, such as when debugging or analyzing a script that includes
+> `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
## EXAMPLES
@@ -205,9 +216,9 @@ $Sample = $Files | Get-Random -Count 50
### Example 11: Roll fair dice
-This example rolls a fair die 1200 times and counts the outcomes. The first command, `ForEach-Object`
-repeats the call to `Get-Random` from the piped in numbers (1-6). The results are grouped by their
-value with `Group-Object` and formatted as a table with `Select-Object`.
+This example rolls a fair die 1200 times and counts the outcomes. The first command,
+`ForEach-Object` repeats the call to `Get-Random` from the piped in numbers (1-6). The results are
+grouped by their value with `Group-Object` and formatted as a table with `Select-Object`.
```powershell 1..1200 | ForEach-Object {
@@ -348,15 +359,17 @@ Accept wildcard characters: False
### -SetSeed
-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 can't reset the seed to its default value.
+Specifies a seed value for the random number generator. When you use **SetSeed**, the cmdlet uses
+the [System.Random](/dotnet/api/system.random) method to generate pseudorandom numbers, which is not
+cryptographically secure.
-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's typically
-used only when trying to reproduce behavior, such as when debugging or analyzing a script that
-includes `Get-Random` commands.
+> [!CAUTION]
+> Setting the seed results in non-random behavior. It should only be used when trying to reproduce
+> behavior, such as when debugging or analyzing a script that includes `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
```yaml Type: System.Nullable`1[System.Int32]
@@ -374,7 +387,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216).
+-WarningAction, and -WarningVariable. For more information, see
+[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -391,8 +405,8 @@ submitted collection.
## NOTES
-`Get-Random` sets a default seed for each session based on the system time clock when the session
-starts.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
`Get-Random` does not alway return the same data type as the input value. The following table shows the output type for each of the numeric input types.
@@ -419,3 +433,7 @@ versions, only the **Maximum** parameter in the **RandomNumberParameterSet** par
an empty string or `$null`. ## RELATED LINKS+
+[System.Security.Cryptography.RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
+
+[Sytem.Random](/dotnet/api/system.random)
Microsoft.PowerShell.Core https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/Wait-Job?view=powershell-7.1 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/Wait-Job.md
@@ -3,7 +3,7 @@ external help file: System.Management.Automation.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 06/09/2017 Last updated : 01/28/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/wait-job?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Wait-Job
@@ -11,8 +11,7 @@ Title: Wait-Job
# Wait-Job ## SYNOPSIS
-Suppresses the command prompt until one or all of the PowerShell background jobs running in
-the session are completed.
+Waits until one or all of the PowerShell jobs running in the session are in a terminating state.
## SYNTAX
@@ -54,16 +53,23 @@ Wait-Job [-Any] [-Timeout <Int32>] [-Force] [-Filter] <Hashtable> [<CommonParame
## DESCRIPTION
-The `Wait-Job` cmdlet waits for PowerShell background jobs to finish before it displays the
-command prompt. You can wait until any background job is complete, or until all background jobs are
-complete, and you can set a maximum wait time for the job.
+The `Wait-Job` cmdlet waits for a job to be in a terminating state before continuing execution.
+The terminating states are:
-When the commands in the job are complete, `Wait-Job` displays the command prompt and returns a job
-object so that you can pipe it to another command.
+- Completed
+- Failed
+- Stopped
+- Suspended
+- Disconnected
-You can use `Wait-Job` cmdlet to wait for background jobs, such as those that were started by using
-the `Start-Job` cmdlet or the **AsJob** parameter of the `Invoke-Command` cmdlet. For more
-information about Windows PowerShell background jobs, see [about_Jobs](./about/about_Jobs.md).
+You can wait until a specified job, or all jobs are in a terminating state. You can also set a
+maximum wait time for the job using the **Timeout** parameter, or use the **Force** parameter to
+wait for a job in the `Suspended` or `Disconnected` states.
+
+When the commands in the job are complete, `Wait-Job` returns a job object and continues execution.
+
+You can use the `Wait-Job` cmdlet to wait for jobs started by using the `Start-Job` cmdlet or the
+**AsJob** parameter of the `Invoke-Command` cmdlet. For more information about jobs, see [about_Jobs](./about/about_Jobs.md).
Starting in Windows PowerShell 3.0, the `Wait-Job` cmdlet also waits for custom job types, such as workflow jobs and instances of scheduled jobs. To enable `Wait-Job` to wait for jobs of a particular
@@ -80,7 +86,7 @@ type feature.
Get-Job | Wait-Job ```
-This command waits for all of the background jobs running in the session to finish.
+This command waits for all of the jobs running in the session to finish.
### Example 2: Wait for jobs started on remote computers by using Start-Job
@@ -99,7 +105,7 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on remote
the `Start-Job` cmdlet. Both `Start-Job` and `Wait-Job` commands are submitted to the remote computer by using the `Invoke-Command` cmdlet.
-This example uses `Wait-Job` to determine whether a `Get-Date` command running as a background job
+This example uses `Wait-Job` to determine whether a `Get-Date` command running as a job
on three different computers is finished. The first command creates a Windows PowerShell session (**PSSession**) on each of the three remote
@@ -108,14 +114,14 @@ computers and stores them in the `$s` variable.
The second command uses `Invoke-Command` to run `Start-Job` in each of the three sessions in `$s`. All of the jobs are named Date1.
-The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the Date1 jobs on
-each computer to finish. It stores the resulting collection (array) of job objects in the `$done`
-variable.
+The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the `Date1` jobs
+on each computer to finish. It stores the resulting collection (**array**) of **job** objects in the
+`$done` variable.
The fourth command uses the **Count** property of the array of job objects in the `$done` variable to determine how many of the jobs are finished.
-### Example 3: Determine when the first background job finishes
+### Example 3: Determine when the first job finishes
```powershell $s = New-PSSession (Get-Content Machines.txt)
@@ -124,9 +130,9 @@ Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {$Using:c}
Invoke-Command -Session $s -ScriptBlock {Wait-Job -Any} ```
-This example uses the **Any** parameter of `Wait-Job` to determine when the first of many background
-jobs running in the current session are completed. It also shows how to use the `Wait-Job` cmdlet to
-wait for remote jobs to finish.
+This example uses the **Any** parameter of `Wait-Job` to determine when the first of many jobs
+running in the current session are in a terminating state. It also shows how to use the `Wait-Job`
+cmdlet to wait for remote jobs to finish.
The first command creates a **PSSession** on each of the computers listed in the Machines.txt file and stores the **PSSession** objects in the `$s` variable. The command uses the `Get-Content` cmdlet
@@ -136,7 +142,7 @@ that it runs before the `New-PSSession` command.
The second command stores a `Get-EventLog` command string, in quotation marks, in the `$c` variable. The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the sessions in `$s`.
-The `Start-Job` command starts a background job that runs the `Get-EventLog` command in the `$c`
+The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c`
variable. The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the
@@ -145,14 +151,15 @@ information about the **Using** scope modifier, see
[about_Remote_Variables](./about/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the
-**Any** parameter to wait until the first job on the remote computers is completed.
+**Any** parameter to wait until the first job on the remote computers is terminating state.
### Example 4: Set a wait time for jobs on remote computers ```powershell
-$s = New-PSSession Server01, Server02, Server03
-$jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
-$done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS> $s = New-PSSession Server01, Server02, Server03
+PS> $jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
+PS> $done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS>
``` This example shows how to use the **Timeout** parameter of `Wait-Job` to set a maximum wait time for
@@ -170,8 +177,8 @@ the **Timeout** parameter with a value of 30 to establish the maximum wait time,
results of the command in the `$done` variable. In this case, after 30 seconds, only the command on the Server02 computer has completed. `Wait-Job`
-ends the wait, displays the command prompt, and returns the object that represents the job that was
-completed.
+ends the wait, returns the object that represents the job that was
+completed, and displays the command prompt.
The `$done` variable contains a job object that represents the job that ran on Server02.
@@ -181,8 +188,8 @@ The `$done` variable contains a job object that represents the job that ran on S
Wait-Job -id 1,2,5 -Any ```
-This command identifies three jobs by their IDs and waits until any one of them are completed.
-The command prompt returns when the first job finishes.
+This command identifies three jobs by their IDs and waits until any one of them are in a terminating
+state. Execution continues when the first job finishes.
### Example 6: Wait for a period, then allow job to continue in background
@@ -191,7 +198,7 @@ Wait-Job -Name "DailyLog" -Timeout 120
``` This command waits 120 seconds (two minutes) for the DailyLog job to finish. If the job does not
-finish in the next two minutes, the command prompt returns anyway, and the job continues to run in
+finish in the next two minutes, execution continues, and the job continues to run in
the background. ### Example 7: Wait for a job by name
@@ -205,7 +212,7 @@ This command uses the job name to identify the job for which to wait.
### Example 8: Wait for jobs on local computer started with Start-Job ```powershell
-$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
+$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_.lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
$j | Wait-Job ```
@@ -215,12 +222,12 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on the loc
These commands start a job that gets the Windows PowerShell script files that were added or updated in the last week.
-The first command uses `Start-Job` to start a background job on the local computer. The job runs a
+The first command uses `Start-Job` to start a job on the local computer. The job runs a
`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were added or updated in the last week.
-The third command uses `Wait-Job` to wait until the job is completed. When the job finishes, the
-command displays the job object, which contains information about the job.
+The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job
+finishes, the command displays the job object, which contains information about the job.
### Example 9: Wait for jobs started on remote computers by using Invoke-Command
@@ -236,15 +243,15 @@ computer and the results are automatically returned to the local computer, even
on the remote computers. This example uses `Wait-Job` to determine whether a `Get-Process` command running in the sessions on
-three remote computers is completed.
+three remote computers is in a terminating state.
The first command creates **PSSession** objects on three computers and stores them in the `$s` variable. The second command uses `Invoke-Command` to run `Get-Process` in each of the three sessions in `$s`.
-The command uses the **AsJob** parameter to run the command asynchronously as a background job. The
-command returns a job object, just like the jobs started by using `Start-Job`, and the job object is
-stored in the `$j` variable.
+The command uses the **AsJob** parameter to run the command asynchronously as a job. The command
+returns a job object, just like the jobs started by using `Start-Job`, and the job object is stored
+in the `$j` variable.
The third command uses a pipeline operator (`|`) to send the job object in `$j` to the `Wait-Job` cmdlet. An `Invoke-Command` command is not required in this case, because the job resides on the
@@ -273,9 +280,9 @@ This command waits for the job with an ID value of 1.
### -Any
-Indicates that this cmdlet displays the command prompt, and returns the job object, when any job
-finishes. By default, `Wait-Job` waits until all of the specified jobs are complete before it
-displays the prompt.
+Indicates that this cmdlet returns the job object and continues execution when any job finishes. By
+default, `Wait-Job` waits until all of the specified jobs are complete before it displays the
+prompt.
```yaml Type: System.Management.Automation.SwitchParameter
@@ -296,8 +303,8 @@ in the hash table. Enter a hash table where the keys are job properties and the
property values. This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not
-work on standard background jobs, such as those created by using the `Start-Job` cmdlet. For
-information about support for this parameter, see the help topic for the job type.
+work on standard jobs, such as those created by using the `Start-Job` cmdlet. For information about
+support for this parameter, see the help topic for the job type.
This parameter was introduced in Windows PowerShell 3.0.
@@ -445,12 +452,12 @@ Accept wildcard characters: False
### -Timeout
-Specifies the maximum wait time for each background job, in seconds. The default value, -1,
-indicates that the cmdlet waits until the job finishes. The timing starts when you submit the
-`Wait-Job` command, not the `Start-Job` command.
+Specifies the maximum wait time for each job, in seconds. The default value, -1, indicates that the
+cmdlet waits until the job finishes. The timing starts when you submit the `Wait-Job` command, not
+the `Start-Job` command.
-If this time is exceeded, the wait ends and the command prompt returns, even if the job is still
-running. The command does not display any error message.
+If this time is exceeded, the wait ends and execution continues, even if the job is still running.
+The command does not display any error message.
```yaml Type: System.Int32
@@ -481,8 +488,8 @@ You can pipe a job object to this cmdlet.
### System.Management.Automation.PSRemotingJob
-This cmdlet returns job objects that represent the completed jobs. If the wait ends because the
-value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
+This cmdlet returns job objects that represent the jobs in a terminating state. If the wait ends
+because the value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
## NOTES
Microsoft.PowerShell.Management https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Clear-RecycleBin?view=powershell-7.1 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Management/Clear-RecycleBin.md
@@ -1,9 +1,8 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
-keywords: powershell,cmdlet
Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 10/28/2019 Last updated : 01/29/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Clear-RecycleBin
@@ -93,7 +92,8 @@ Accept wildcard characters: False
### -Force
-Specifies that the user isn't prompted for confirmation to clear a recycle bin.
+Specifies that the user isn't prompted for confirmation to clear a recycle bin. The **Force**
+parameter also overrides the **WhatIf** and **Confirm** parameters.
```yaml Type: System.Management.Automation.SwitchParameter
Microsoft.PowerShell.Utility https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Get-Random?view=powershell-7.1 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Utility/Get-Random.md
@@ -1,14 +1,12 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
-keywords: powershell,cmdlet
Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 05/20/2020 Last updated : 02/02/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-random?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-Random - # Get-Random ## SYNOPSIS
@@ -42,8 +40,20 @@ The `Get-Random` cmdlet gets a randomly selected number. If you submit a collect
Without parameters or input, a `Get-Random` command returns a randomly selected 32-bit unsigned integer between 0 (zero) and **Int32.MaxValue** (`0x7FFFFFFF`, `2,147,483,647`).
-You can use the parameters of `Get-Random` to specify a seed number, minimum and maximum values, the
-number of objects returned from a submitted collection, and the entire collection in a random order.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
+
+You can use the parameters of `Get-Random` to specify the minimum and maximum values, the number of
+objects returned from a collection, or a seed number.
+
+> [!CAUTION]
+> Setting the seed deliberately results in non-random, repeatable behavior. It should only be used
+> when trying to reproduce behavior, such as when debugging or analyzing a script that includes
+> `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
## EXAMPLES
@@ -208,9 +218,9 @@ $Sample = $Files | Get-Random -Count 50
### Example 11: Roll fair dice
-This example rolls a fair die 1200 times and counts the outcomes. The first command, `ForEach-Object`
-repeats the call to `Get-Random` from the piped in numbers (1-6). The results are grouped by their
-value with `Group-Object` and formatted as a table with `Select-Object`.
+This example rolls a fair die 1200 times and counts the outcomes. The first command,
+`ForEach-Object` repeats the call to `Get-Random` from the piped in numbers (1-6). The results are
+grouped by their value with `Group-Object` and formatted as a table with `Select-Object`.
```powershell 1..1200 | ForEach-Object {
@@ -351,15 +361,17 @@ Accept wildcard characters: False
### -SetSeed
-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 can't reset the seed to its default value.
+Specifies a seed value for the random number generator. When you use **SetSeed**, the cmdlet uses
+the [System.Random](/dotnet/api/system.random) method to generate pseudorandom numbers, which is not
+cryptographically secure.
-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's typically
-used only when trying to reproduce behavior, such as when debugging or analyzing a script that
-includes `Get-Random` commands.
+> [!CAUTION]
+> Setting the seed results in non-random behavior. It should only be used when trying to reproduce
+> behavior, such as when debugging or analyzing a script that includes `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
```yaml Type: System.Nullable`1[System.Int32]
@@ -393,7 +405,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216).
+-WarningAction, and -WarningVariable. For more information, see
+[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -410,8 +423,8 @@ submitted collection.
## NOTES
-`Get-Random` sets a default seed for each session based on the system time clock when the session
-starts.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
`Get-Random` does not alway return the same data type as the input value. The following table shows the output type for each of the numeric input types.
@@ -439,3 +452,6 @@ an empty string or `$null`.
## RELATED LINKS
+[System.Security.Cryptography.RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
+
+[Sytem.Random](/dotnet/api/system.random)
Microsoft.PowerShell.Core https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/Wait-Job?view=powershell-7.2 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/Wait-Job.md
@@ -2,7 +2,7 @@
external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core Previously updated : 06/09/2017 Last updated : 01/28/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/wait-job?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Wait-Job
@@ -10,8 +10,7 @@ Title: Wait-Job
# Wait-Job ## SYNOPSIS
-Suppresses the command prompt until one or all of the PowerShell background jobs running in
-the session are completed.
+Waits until one or all of the PowerShell jobs running in the session are in a terminating state.
## SYNTAX
@@ -53,16 +52,23 @@ Wait-Job [-Any] [-Timeout <Int32>] [-Force] [-Filter] <Hashtable> [<CommonParame
## DESCRIPTION
-The `Wait-Job` cmdlet waits for PowerShell background jobs to finish before it displays the
-command prompt. You can wait until any background job is complete, or until all background jobs are
-complete, and you can set a maximum wait time for the job.
+The `Wait-Job` cmdlet waits for a job to be in a terminating state before continuing execution.
+The terminating states are:
-When the commands in the job are complete, `Wait-Job` displays the command prompt and returns a job
-object so that you can pipe it to another command.
+- Completed
+- Failed
+- Stopped
+- Suspended
+- Disconnected
-You can use `Wait-Job` cmdlet to wait for background jobs, such as those that were started by using
-the `Start-Job` cmdlet or the **AsJob** parameter of the `Invoke-Command` cmdlet. For more
-information about Windows PowerShell background jobs, see [about_Jobs](./about/about_Jobs.md).
+You can wait until a specified job, or all jobs are in a terminating state. You can also set a
+maximum wait time for the job using the **Timeout** parameter, or use the **Force** parameter to
+wait for a job in the `Suspended` or `Disconnected` states.
+
+When the commands in the job are complete, `Wait-Job` returns a job object and continues execution.
+
+You can use the `Wait-Job` cmdlet to wait for jobs started by using the `Start-Job` cmdlet or the
+**AsJob** parameter of the `Invoke-Command` cmdlet. For more information about jobs, see [about_Jobs](./about/about_Jobs.md).
Starting in Windows PowerShell 3.0, the `Wait-Job` cmdlet also waits for custom job types, such as workflow jobs and instances of scheduled jobs. To enable `Wait-Job` to wait for jobs of a particular
@@ -79,7 +85,7 @@ type feature.
Get-Job | Wait-Job ```
-This command waits for all of the background jobs running in the session to finish.
+This command waits for all of the jobs running in the session to finish.
### Example 2: Wait for jobs started on remote computers by using Start-Job
@@ -98,7 +104,7 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on remote
the `Start-Job` cmdlet. Both `Start-Job` and `Wait-Job` commands are submitted to the remote computer by using the `Invoke-Command` cmdlet.
-This example uses `Wait-Job` to determine whether a `Get-Date` command running as a background job
+This example uses `Wait-Job` to determine whether a `Get-Date` command running as a job
on three different computers is finished. The first command creates a Windows PowerShell session (**PSSession**) on each of the three remote
@@ -107,14 +113,14 @@ computers and stores them in the `$s` variable.
The second command uses `Invoke-Command` to run `Start-Job` in each of the three sessions in `$s`. All of the jobs are named Date1.
-The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the Date1 jobs on
-each computer to finish. It stores the resulting collection (array) of job objects in the `$done`
-variable.
+The third command uses `Invoke-Command` to run `Wait-Job`. This command waits for the `Date1` jobs
+on each computer to finish. It stores the resulting collection (**array**) of **job** objects in the
+`$done` variable.
The fourth command uses the **Count** property of the array of job objects in the `$done` variable to determine how many of the jobs are finished.
-### Example 3: Determine when the first background job finishes
+### Example 3: Determine when the first job finishes
```powershell $s = New-PSSession (Get-Content Machines.txt)
@@ -123,9 +129,9 @@ Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {$Using:c}
Invoke-Command -Session $s -ScriptBlock {Wait-Job -Any} ```
-This example uses the **Any** parameter of `Wait-Job` to determine when the first of many background
-jobs running in the current session are completed. It also shows how to use the `Wait-Job` cmdlet to
-wait for remote jobs to finish.
+This example uses the **Any** parameter of `Wait-Job` to determine when the first of many jobs
+running in the current session are in a terminating state. It also shows how to use the `Wait-Job`
+cmdlet to wait for remote jobs to finish.
The first command creates a **PSSession** on each of the computers listed in the Machines.txt file and stores the **PSSession** objects in the `$s` variable. The command uses the `Get-Content` cmdlet
@@ -135,7 +141,7 @@ that it runs before the `New-PSSession` command.
The second command stores a `Get-EventLog` command string, in quotation marks, in the `$c` variable. The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the sessions in `$s`.
-The `Start-Job` command starts a background job that runs the `Get-EventLog` command in the `$c`
+The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c`
variable. The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the
@@ -144,14 +150,15 @@ information about the **Using** scope modifier, see
[about_Remote_Variables](./about/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the
-**Any** parameter to wait until the first job on the remote computers is completed.
+**Any** parameter to wait until the first job on the remote computers is terminating state.
### Example 4: Set a wait time for jobs on remote computers ```powershell
-$s = New-PSSession Server01, Server02, Server03
-$jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
-$done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS> $s = New-PSSession Server01, Server02, Server03
+PS> $jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}}
+PS> $done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}
+PS>
``` This example shows how to use the **Timeout** parameter of `Wait-Job` to set a maximum wait time for
@@ -169,8 +176,8 @@ the **Timeout** parameter with a value of 30 to establish the maximum wait time,
results of the command in the `$done` variable. In this case, after 30 seconds, only the command on the Server02 computer has completed. `Wait-Job`
-ends the wait, displays the command prompt, and returns the object that represents the job that was
-completed.
+ends the wait, returns the object that represents the job that was
+completed, and displays the command prompt.
The `$done` variable contains a job object that represents the job that ran on Server02.
@@ -180,8 +187,8 @@ The `$done` variable contains a job object that represents the job that ran on S
Wait-Job -id 1,2,5 -Any ```
-This command identifies three jobs by their IDs and waits until any one of them are completed.
-The command prompt returns when the first job finishes.
+This command identifies three jobs by their IDs and waits until any one of them are in a terminating
+state. Execution continues when the first job finishes.
### Example 6: Wait for a period, then allow job to continue in background
@@ -190,7 +197,7 @@ Wait-Job -Name "DailyLog" -Timeout 120
``` This command waits 120 seconds (two minutes) for the DailyLog job to finish. If the job does not
-finish in the next two minutes, the command prompt returns anyway, and the job continues to run in
+finish in the next two minutes, execution continues, and the job continues to run in
the background. ### Example 7: Wait for a job by name
@@ -204,7 +211,7 @@ This command uses the job name to identify the job for which to wait.
### Example 8: Wait for jobs on local computer started with Start-Job ```powershell
-$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
+$j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_.lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}}
$j | Wait-Job ```
@@ -214,12 +221,12 @@ This example shows how to use the `Wait-Job` cmdlet with jobs started on the loc
These commands start a job that gets the Windows PowerShell script files that were added or updated in the last week.
-The first command uses `Start-Job` to start a background job on the local computer. The job runs a
+The first command uses `Start-Job` to start a job on the local computer. The job runs a
`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were added or updated in the last week.
-The third command uses `Wait-Job` to wait until the job is completed. When the job finishes, the
-command displays the job object, which contains information about the job.
+The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job
+finishes, the command displays the job object, which contains information about the job.
### Example 9: Wait for jobs started on remote computers by using Invoke-Command
@@ -235,15 +242,15 @@ computer and the results are automatically returned to the local computer, even
on the remote computers. This example uses `Wait-Job` to determine whether a `Get-Process` command running in the sessions on
-three remote computers is completed.
+three remote computers is in a terminating state.
The first command creates **PSSession** objects on three computers and stores them in the `$s` variable. The second command uses `Invoke-Command` to run `Get-Process` in each of the three sessions in `$s`.
-The command uses the **AsJob** parameter to run the command asynchronously as a background job. The
-command returns a job object, just like the jobs started by using `Start-Job`, and the job object is
-stored in the `$j` variable.
+The command uses the **AsJob** parameter to run the command asynchronously as a job. The command
+returns a job object, just like the jobs started by using `Start-Job`, and the job object is stored
+in the `$j` variable.
The third command uses a pipeline operator (`|`) to send the job object in `$j` to the `Wait-Job` cmdlet. An `Invoke-Command` command is not required in this case, because the job resides on the
@@ -272,9 +279,9 @@ This command waits for the job with an ID value of 1.
### -Any
-Indicates that this cmdlet displays the command prompt, and returns the job object, when any job
-finishes. By default, `Wait-Job` waits until all of the specified jobs are complete before it
-displays the prompt.
+Indicates that this cmdlet returns the job object and continues execution when any job finishes. By
+default, `Wait-Job` waits until all of the specified jobs are complete before it displays the
+prompt.
```yaml Type: System.Management.Automation.SwitchParameter
@@ -295,8 +302,8 @@ in the hash table. Enter a hash table where the keys are job properties and the
property values. This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not
-work on standard background jobs, such as those created by using the `Start-Job` cmdlet. For
-information about support for this parameter, see the help topic for the job type.
+work on standard jobs, such as those created by using the `Start-Job` cmdlet. For information about
+support for this parameter, see the help topic for the job type.
This parameter was introduced in Windows PowerShell 3.0.
@@ -444,12 +451,12 @@ Accept wildcard characters: False
### -Timeout
-Specifies the maximum wait time for each background job, in seconds. The default value, -1,
-indicates that the cmdlet waits until the job finishes. The timing starts when you submit the
-`Wait-Job` command, not the `Start-Job` command.
+Specifies the maximum wait time for each job, in seconds. The default value, -1, indicates that the
+cmdlet waits until the job finishes. The timing starts when you submit the `Wait-Job` command, not
+the `Start-Job` command.
-If this time is exceeded, the wait ends and the command prompt returns, even if the job is still
-running. The command does not display any error message.
+If this time is exceeded, the wait ends and execution continues, even if the job is still running.
+The command does not display any error message.
```yaml Type: System.Int32
@@ -480,8 +487,8 @@ You can pipe a job object to this cmdlet.
### System.Management.Automation.PSRemotingJob
-This cmdlet returns job objects that represent the completed jobs. If the wait ends because the
-value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
+This cmdlet returns job objects that represent the jobs in a terminating state. If the wait ends
+because the value of the **Timeout** parameter is exceeded, `Wait-Job` does not return any objects.
## NOTES
Microsoft.PowerShell.Management https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Clear-RecycleBin?view=powershell-7.2 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Management/Clear-RecycleBin.md
@@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 10/28/2019 Last updated : 01/29/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Clear-RecycleBin
@@ -92,7 +92,8 @@ Accept wildcard characters: False
### -Force
-Specifies that the user isn't prompted for confirmation to clear a recycle bin.
+Specifies that the user isn't prompted for confirmation to clear a recycle bin. The **Force**
+parameter also overrides the **WhatIf** and **Confirm** parameters.
```yaml Type: System.Management.Automation.SwitchParameter
Microsoft.PowerShell.Utility https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Get-Random?view=powershell-7.2 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Utility/Get-Random.md
@@ -2,12 +2,11 @@
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 05/20/2020 Last updated : 02/02/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-random?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-Random - # Get-Random ## SYNOPSIS
@@ -41,8 +40,20 @@ The `Get-Random` cmdlet gets a randomly selected number. If you submit a collect
Without parameters or input, a `Get-Random` command returns a randomly selected 32-bit unsigned integer between 0 (zero) and **Int32.MaxValue** (`0x7FFFFFFF`, `2,147,483,647`).
-You can use the parameters of `Get-Random` to specify a seed number, minimum and maximum values, the
-number of objects returned from a submitted collection, and the entire collection in a random order.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
+
+You can use the parameters of `Get-Random` to specify the minimum and maximum values, the number of
+objects returned from a collection, or a seed number.
+
+> [!CAUTION]
+> Setting the seed deliberately results in non-random, repeatable behavior. It should only be used
+> when trying to reproduce behavior, such as when debugging or analyzing a script that includes
+> `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
## EXAMPLES
@@ -207,9 +218,9 @@ $Sample = $Files | Get-Random -Count 50
### Example 11: Roll fair dice
-This example rolls a fair die 1200 times and counts the outcomes. The first command, `ForEach-Object`
-repeats the call to `Get-Random` from the piped in numbers (1-6). The results are grouped by their
-value with `Group-Object` and formatted as a table with `Select-Object`.
+This example rolls a fair die 1200 times and counts the outcomes. The first command,
+`ForEach-Object` repeats the call to `Get-Random` from the piped in numbers (1-6). The results are
+grouped by their value with `Group-Object` and formatted as a table with `Select-Object`.
```powershell 1..1200 | ForEach-Object {
@@ -350,15 +361,17 @@ Accept wildcard characters: False
### -SetSeed
-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 can't reset the seed to its default value.
+Specifies a seed value for the random number generator. When you use **SetSeed**, the cmdlet uses
+the [System.Random](/dotnet/api/system.random) method to generate pseudorandom numbers, which is not
+cryptographically secure.
-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's typically
-used only when trying to reproduce behavior, such as when debugging or analyzing a script that
-includes `Get-Random` commands.
+> [!CAUTION]
+> Setting the seed results in non-random behavior. It should only be used when trying to reproduce
+> behavior, such as when debugging or analyzing a script that includes `Get-Random` commands.
+>
+> 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 can't reset the seed
+> to its default value.
```yaml Type: System.Nullable`1[System.Int32]
@@ -392,7 +405,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216).
+-WarningAction, and -WarningVariable. For more information, see
+[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -409,8 +423,8 @@ submitted collection.
## NOTES
-`Get-Random` sets a default seed for each session based on the system time clock when the session
-starts.
+By default, `Get-Random` generates cryptographically secure randomness using the
+[RandomNumberGenerator](/dotnet/api/system.security.cryptography.randomnumbergenerator) class.
`Get-Random` does not alway return the same data type as the input value. The following table shows the output type for each of the numeric input types.
@@ -438,3 +452,6 @@ an empty string or `$null`.
## RELATED LINKS
+[System.Security.Cryptography.RandomNumberGenerator()](/dotnet/api/system.security.cryptography.randomnumbergenerator)
+
+[Sytem.Random](/dotnet/api/system.random)
community https://docs.microsoft.com/en-us/powershell/scripting/community/2020-Q1 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/community/2020-Q1.md
@@ -1,109 +0,0 @@
- Title: What's New in PowerShell Docs for 2020-Q1
-description: List of changes to the PowerShell documentation for 2020-Q1
Previously updated : 03/31/2020--
-# What's new in PowerShell Docs for 2020-Q1
-
-This article lists some of the major changes to docs during this previous month and celebrates the
-contributions from the community.
-
-Help us make the documentation better for you. Read the [Contributor's Guide][contrib] to learn how
-to get started.
-
-## 2020-March
-
-### Highlights
--- New documents
- - The PowerShell Docs community pages
- - [Community resources](/powershell/scripting/community/community-support) page
- - [What's new in PowerShell Docs](#2020-march) page (this page)
- - [PowerShell Infographic](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/assets/PowerShell_7_Infographic.pdf)
- added to the Digital Art page
- - [PowerShell-Doc contributor guide](/powershell/scripting/community/contributing/overview)
- - New PowerShell content
- - [Migrating from Windows PowerShell 5.1 to PowerShell 7](/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7)
- - [PowerShell 7 module compatibility list](/PowerShell/scripting/whats-new/module-compatibility)
- - [Using PowerShell in Docker](/powershell/scripting/install/powershell-in-docker)
- - New Wiki content
- - [PowerShell prevents exceptions for non existent keys for types that implement IDictionary TKey, TValue](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/PowerShell-prevents-exceptions-for-non-existent-keys-for-types-that-implement-IDictionary-TKey,-TValue-)
- - [PowerShell's treatment of namespaces is case insensitive but case preserving](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/PowerShell's-treatment-of-namespaces-is-case-insensitive-but-case-preserving)
--- Documentation maintenance
- - Massive cleanup of broken links
- - Cleanup of old and duplicate issues
--- GitHub stats
- - 100 PRs merged (14 from Community)
- - 68 issues opened (56 from Community)
- - 109 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filling
-issues. Thank you!
--- k-takai - 7 PRs-- mklement0 - 5 issues-- juvtib - 4 issues-- iSazonov - 3 issue-- doctordns - 2 issues-- mdorantesm - 2 issues-- qt3m45su0najc7 - 2 issues-
-## 2020-February
-
-### Highlights
--- New documents
- - [about_Parameter_Sets](/powershell/module/microsoft.powershell.core/about/about_parameter_sets)
- - [Release history of modules and cmdlets](/powershell/scripting/whats-new/cmdlet-versions)
-- PowerShell 7 documentation updates-- Updates to address issues-- Ran PlatyPS to verify parameter info for all cmdlets and versions-- GitHub stats
- - 52 PRs merged (9 from Community)
- - 49 issues opened (42 from Community)
- - 55 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filling
-issues. Thank you!
--- Maamue - 2 PRs-- doctordns - 2 PRs-- mklement0 - 4 issues-- he852100 - 3 issues-- VectorBCO - 2 issues-- metablaster - 2 issues-
-## 2020-January
-
-### Highlights
--- New documents
- - [about_Windows_PowerShell_Compatibility](/powershell/module/microsoft.powershell.core/about/about_Windows_PowerShell_Compatibility)
-- PowerShell 7 documentation updates-- Updates to address issues-- GitHub stats
- - 58 PRs merged (7 from Community)
- - 57 issues opened (43 from Community)
- - 70 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filling
-issues. Thank you!
--- Makovec - 3 PRs-- mklement0 - 9 issues-- mvadu - 2 issues-- razos - 2 issues-- VLoub - 2 issues-- doctordns - 2 issues-
-<!-- Link references -->
-[contrib]: contributing/overview.md
community https://docs.microsoft.com/en-us/powershell/scripting/community/2020-Q2 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/community/2020-Q2.md
@@ -1,164 +0,0 @@
- Title: What's New in PowerShell Docs for 2020-Q2
-description: List of changes to the PowerShell documentation for 2020-Q2
Previously updated : 07/31/2020--
-# What's new in PowerShell Docs for 2020-Q2
-
-This article lists some of the major changes to docs during this previous month and celebrates the
-contributions from the community.
-
-Help us make the documentation better for you. Read the [Contributor's Guide][contrib] to learn how
-to get started.
-
-## 2020-June Highlights
--- New PowerShell documentation
- - Published new [PowerShell 101](../learn/ps101/00-introduction.md) content contributed by Mike F.
- Robbins
- - Added two recent blog posts from Rob Holt to the **Scripting and development** docs
- - [Choosing the right PowerShell NuGet package for your .NET project](/powershell/scripting/dev-cross-plat/choosing-the-right-nuget-package)
- - [Resolving PowerShell module assembly dependency conflicts](/powershell/scripting/dev-cross-plat/resolving-dependency-conflicts)
-- Documentation maintenance
- - Archived older content to [https://aka.ms/PSLegacyDocs](https://aka.ms/PSLegacyDocs)
- - PowerShell Web Access SDK content
- - PowerShell Workflows SDK content
- - Updates for 7.1-preview content
--- GitHub stats
- - 83 PRs merged (15 from Community)
- - 68 issues opened (52 from Community)
- - 74 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filling
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| - | :--: | :--: |
-| doctordns | 3 | |
-| gabrielmccoll | 2 | |
-| adrianhale | 1 | |
-| aisbergde | 1 | |
-| beatcracker | 1 | |
-| bergmeister | 1 | |
-| DarioArzaba | 1 | |
-| gforceg | 1 | |
-| jpomfret | 1 | |
-| Karl-WE | 1 | |
-| signalwarrant | 1 | |
-| skycommand | 1 | |
-| tkhadimullin | 1 | |
-| johnkberry | | 2 |
-| juvtib | | 2 |
-| mklement0 | | 2 |
-| Sagatboy33 | | 4 |
-
-## 2020-May Highlights
--- New PowerShell documentation
- - Created a new [Deep dives](../learn/deep-dives/overview.md) section containing content from
- community contributor Kevin Marquette
- - [Everything you want to know about arrays](../learn/deep-dives/everything-about-arrays.md)
- - [Everything you want to know about hashtables](../learn/deep-dives/everything-about-hashtable.md)
- - [Everything you want to know about PSCustomObject](../learn/deep-dives/everything-about-pscustomobject.md)
- - [Everything you want to know about string substitution](../learn/deep-dives/everything-about-string-substitutions.md)
- - [Everything you want to know about if/then/else](../learn/deep-dives/everything-about-if.md)
- - [Everything you want to know about switch](../learn/deep-dives/everything-about-switch.md)
- - [Everything you want to know about exceptions](../learn/deep-dives/everything-about-exceptions.md)
- - [Everything you want to know about $null](../learn/deep-dives/everything-about-null.md)
- - [Everything you want to know about ShouldProcess](../learn/deep-dives/everything-about-shouldprocess.md)
- - [How to create a Standard Library binary module](../dev-cross-plat/create-standard-library-binary-module.md)
- - Published the [PowerShell 7.0 .NET API](/dotnet/api/?view=powershellsdk-7.0.0&preserve-view=true)
- reference
- - `Update-Help -Force` for PowerShell 5.1 now downloads updated content for the core PowerShell
- modules
-- Documentation maintenance
- - Major reorganization of the Table of Contents
- - New content under **Learning PowerShell**
- - Windows PowerShell 5.1 content collected in one location
- - Archived older content to [https://aka.ms/PSLegacyDocs](https://aka.ms/PSLegacyDocs)
- - PowerShell Web Access
- - PowerShell Workflows Guide
- - Updates for 7.1-preview content
--- GitHub stats
- - 81 PRs merged (21 from Community)
- - 61 issues opened (53 from Community)
- - 64 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filling
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| -- | :--: | :--: |
-| nschonni | 10 | |
-| xtqqczze | 2 | 1 |
-| kilasuit | 1 | 1 |
-| davidseibel | 1 | |
-| doctordns | 1 | |
-| jhoffmann271 | 1 | |
-| KevinMarquette | 1 | |
-| klitztuch | 1 | |
-| markojorge | 1 | |
-| perjahn | 1 | |
-| schuelermine | 1 | |
-| jsilverm | | 7 |
-| mklement0 | | 5 |
-| cam1170 | | 2 |
-| JustinGrote | | 2 |
-| peetrike | | 2 |
-
-## 2020-April Highlights
--- New documents
- - PowerShell documentation
- - [Using Experimental Features](/powershell/scripting/whats-new/experimental-features)
- - [about_PSModulePath](/powershell/module/microsoft.powershell.core/about/about_psmodulepath)
- - Wiki articles
- - [The case for and against Invoke-Expression](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/The-case-for-and-against-Invoke-Expression)
- - [Variables can be assigned values as part of an expression (with limitations)](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/Variables-can-be-assigned-values-as-part-of-an-expression-(with-limitations))
--- Documentation maintenance
- - Now publishing updates to docs.microsoft.com on a daily schedule
- - Monday-Friday 3pm Redmond Time (UTC-8)
- - Restructured the Community content
- - Many editorial cleanups
- - Updated Contributor Guide
- - Clarified some formatting rules
- - New information about table formatting
--- GitHub stats
- - 74 PRs merged (8 from Community)
- - 79 issues opened (71 from Community)
- - 102 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filling
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| - | :--: | :--: |
-| ScSurber | 1 | 1 |
-| alexandair | 1 | |
-| bmkaiser | 1 | |
-| hyoshioka0128 | 1 | |
-| jpomfret | 1 | |
-| raydixon | 1 | |
-| signalwarrant | 1 | |
-| mklement0 | | 8 |
-| reinierk | | 3 |
-| scabon | | 2 |
-| Abdullah0820 | | 2 |
-| awooga | | 2 |
-| Damag3d | | 2 |
-| Fiasco123 | | 2 |
-| Jasonthurston | | 2 |
-
-<!-- Link references -->
-[contrib]: contributing/overview.md
community https://docs.microsoft.com/en-us/powershell/scripting/community/2020-Q3 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/community/2020-Q3.md
@@ -1,118 +0,0 @@
- Title: What's New in PowerShell Docs for 2020-Q3
-description: List of changes to the PowerShell documentation for Q3 of 2020
Previously updated : 10/12/2020--
-# What's new in PowerShell Docs for 2020-Q3
-
-This article lists some of the major changes to docs during this previous month and celebrates the
-contributions from the community.
-
-Help us make the documentation better for you. Read the [Contributor's Guide][contrib] to learn how
-to get started.
--
-## 2020-September Highlights
--- Documentation maintenance
- - Updates for 7.1-preview content
--- Community presentation
- - How to contribute to Docs for RTPUG - https://www.youtube.com/watch?v=0_DEB61YOMc
--- GitHub stats
- - 41 PRs merged (9 from Community)
- - 52 issues opened (47 from Community)
- - 51 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filing
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| - | :--: | :--: |
-| doctordns | 1 | |
-| fatherjack | 1 | |
-| goforgold | 1 | |
-| jonathanweinberg | 1 | |
-| kvprasoon | 1 | |
-| skycommand | 1 | |
-| springcomp | 1 | |
-| themichaelbender | 1 | |
-| toddryan | 1 | |
-| mklement0 | | 13 |
-| setpeetrike | | 2 |
-
-## 2020-August Highlights
--- New PowerShell documentation
- - [About_Calculated_Properties](/powershell/module/microsoft.powershell.core/about/about_calculated_properties)
- - [Writing Progress across multiple threads with Foreach Parallel](/powershell/scripting/learn/deep-dives/write-progress-across-multiple-threads)
-- Documentation maintenance
- - Updates for 7.1-preview content
--- GitHub stats
- - 69 PRs merged (26 from Community)
- - 68 issues opened (49 from Community)
- - 58 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filing
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| - | :--: | :--: |
-| sethvs | 10 | 2 |
-| yecril71pl | 10 | |
-| mklement0 | 1 | 7 |
-| springcomp | 1 | 2 |
-| SquirrelAssassin | | 2 |
-| thorstenbutz | | 2 |
-| aetos382 | 1 | |
-| crumdev | 1 | |
-| joshSi | 1 | |
-| kmoad | 1 | |
-
-## 2020-July Highlights
--- New PowerShell documentation
- - Resurrected old [ETS docs](/powershell/scripting/developer/ets/overview) - 7 articles added
- - Added article about [creating updateable help using PlatyPS](/powershell/scripting/dev-cross-plat/create-help-using-platyps)
-- Documentation maintenance
- - Updates for 7.1-preview content
- - Updated page header - simplified menu choices and added a download button
- - Fixed several `Update-Help` issues
- - Help for PSDesiredStateConfiguration and ThreadJob modules now downloads
- - Published updateable help for PowerShell 7.1 preview
- - Updateable help for PowerShell 5.1 now includes About topics
--- GitHub stats
- - 99 PRs merged (29 from Community)
- - 51 issues opened (44 from Community)
- - 71 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filing
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| -- | :--: | :--: |
-| yecril71pl | 10 | 3 |
-| sethvs | 10 | |
-| springcomp | 3 | 2 |
-| txtor | 2 | 1 |
-| baardhermansen | 1 | |
-| skycommand | 1 | |
-| srjennings | 1 | |
-| xtqqczze | 1 | |
-| mklement0 | | 3 |
-| Allexxann | | 2 |
-| sharpninja | | 2 |
-| XuHeng1021 | | 2 |
-
-<!-- Link references -->
-[contrib]: contributing/overview.md
community https://docs.microsoft.com/en-us/powershell/scripting/community/2020-Q4 https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/community/2020-Q4.md
@@ -1,130 +0,0 @@
- Title: What's New in PowerShell Docs for 2020-Q4
-description: List of changes to the PowerShell documentation for Q4 of 2020
Previously updated : 01/05/2021--
-# What's new in PowerShell Docs for 2020-Q4
-
-This article lists some of the major changes to docs during this previous month and celebrates the
-contributions from the community.
-
-Help us make the documentation better for you. Read the [Contributor's Guide][contrib] to learn how
-to get started.
-
-<!-- Link references -->
-[contrib]: contributing/overview.md
-<!-- -->
-
-## 2020-December Highlights
--- Updated contributor guide
- - documented the `&preserve_view=true` query parameter for hyperlinks
- - documented cross-reference syntax for hyperlinks
- - added information about localization
--- GitHub stats
- - 44 PRs merged (11 from Community)
- - 50 issues opened (43 from Community)
- - 50 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filing
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| - | :--: | :--: |
-| doctordns | 3 | 2 |
-| chadbaldwin | 1 | |
-| dawedawe | 1 | |
-| dumpvn | 1 | |
-| kvprasoon | 1 | |
-| lbearl | 1 | |
-| petershen0307 | 1 | |
-| skycommand | 1 | |
-| springcomp | 1 | |
-| Cwilson-dataselfcom | | 5 |
-| bobbybatatina | | 2 |
-
-## 2020-November Highlights
--- PowerShell 7.1 GA Release
- - What's New in PowerShell 7.1
- - Converted 7.1 docs to release status
- - Added 7.2 (preview) docs
- - Retired v6 docs to archive repository
--- Blog posts
- - [You've got Help!](https://devblogs.microsoft.com/powershell/youve-got-help/)
- - [Updating help for the PSReadLine module](https://devblogs.microsoft.com/powershell/updating-help-for-the-psreadline-module/)
--- Documentation maintenance
- - Updated 137 articles to remove MSDN and TechNet references
- - Updated 171 articles to indicate Windows-only compatibility
- - Updated 38 articles to address build warnings and suggestions
- - Added include to 24 DSC articles
- - Major rewrite of the PowerShell Jobs articles
- - [about_Jobs](/powershell/module/microsoft.powershell.core/about/about_jobs)
- - [about_Remote_Jobs](/powershell/module/microsoft.powershell.core/about/about_remote_jobs)
- - [about_Thread_Jobs](/powershell/module/microsoft.powershell.core/about/about_thread_jobs)
--- GitHub stats
- - 50 PRs merged (8 from Community)
- - 55 issues opened (45 from Community)
- - 51 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filing
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| | :--: | :--: |
-| AlanFlorance | 1 | |
-| gilbertbw | 1 | |
-| ianwalkeruk | 1 | |
-| JeremyTBradshaw | 1 | |
-| matt9ucci | 1 | |
-| Rob-S | 1 | |
-| ShaydeNofziger | 1 | |
-| skycommand | 1 | |
-| juvtib | | 8 |
-| iRon7 | | 2 |
-| l-ip | | 2 |
-| stephenrgentry | | 2 |
-| Vixb1122 | | 2 |
-
-## 2020-October Highlights
--- New articles
- - [about_Character_Encoding](/powershell/module/microsoft.powershell.core/about/about_character_encoding)
- - [about_Output_Streams](/powershell/module/microsoft.powershell.core/about/about_output_streams)
- - [Using Visual Studio Code to debug compiled cmdlets](/powershell/scripting/dev-cross-plat/vscode/using-vscode-for-debugging-compiled-cmdlets) (thanks @fsackur)
- - [Add Credential support to PowerShell functions](/powershell/scripting/learn/deep-dives/add-credentials-to-powershell-functions) (thanks @joshduffney)
--- Documentation maintenance
- - Updates for 7.1-rc content
- - Updated all article descriptions to improve SEO
--- GitHub stats
- - 61 PRs merged (7 from Community)
- - 49 issues opened (42 from Community)
- - 61 issues closed
-
-### Top Community Contributors
-
-The following people have contributed to PowerShell docs by submitting pull requests or filing
-issues. Thank you!
-
-| GitHub Id | PRs merged | Issues opened |
-| | :--: | :--: |
-| doctordns | 1 | |
-| escape208 | 1 | |
-| nickdevore | 1 | |
-| fsackur | 1 | |
-| Duffney | 1 | |
-| skycommand | 1 | |
-| yecril71pl | 1 | |
-| mklement0 | | 3 |
-| Abdullah0820 | | 2 |
community https://docs.microsoft.com/en-us/powershell/scripting/community/2020-updates https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/community/2020-updates.md
@@ -0,0 +1,472 @@
+
+ Title: What's New in PowerShell Docs for 2020-Q4
+description: List of changes to the PowerShell documentation for Q4 of 2020
Last updated : 01/05/2021++
+# What's new in PowerShell Docs for 2020-Q4
+
+This article lists some of the major changes to docs during this previous month and celebrates the
+contributions from the community.
+
+Help us make the documentation better for you. Read the [Contributor's Guide][contrib] to learn how
+to get started.
+
+<!-- Link references -->
+[contrib]: contributing/overview.md
+<!-- -->
+
+## 2020-December Highlights
+
+- Updated contributor guide
+ - documented the `&preserve_view=true` query parameter for hyperlinks
+ - documented cross-reference syntax for hyperlinks
+ - added information about localization
+
+- GitHub stats
+ - 44 PRs merged (11 from Community)
+ - 50 issues opened (43 from Community)
+ - 50 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filing
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| - | :--: | :--: |
+| doctordns | 3 | 2 |
+| chadbaldwin | 1 | |
+| dawedawe | 1 | |
+| dumpvn | 1 | |
+| kvprasoon | 1 | |
+| lbearl | 1 | |
+| petershen0307 | 1 | |
+| skycommand | 1 | |
+| springcomp | 1 | |
+| Cwilson-dataselfcom | | 5 |
+| bobbybatatina | | 2 |
+
+## 2020-November Highlights
+
+- PowerShell 7.1 GA Release
+ - What's New in PowerShell 7.1
+ - Converted 7.1 docs to release status
+ - Added 7.2 (preview) docs
+ - Retired v6 docs to archive repository
+
+- Blog posts
+ - [You've got Help!](https://devblogs.microsoft.com/powershell/youve-got-help/)
+ - [Updating help for the PSReadLine module](https://devblogs.microsoft.com/powershell/updating-help-for-the-psreadline-module/)
+
+- Documentation maintenance
+ - Updated 137 articles to remove MSDN and TechNet references
+ - Updated 171 articles to indicate Windows-only compatibility
+ - Updated 38 articles to address build warnings and suggestions
+ - Added include to 24 DSC articles
+ - Major rewrite of the PowerShell Jobs articles
+ - [about_Jobs](/powershell/module/microsoft.powershell.core/about/about_jobs)
+ - [about_Remote_Jobs](/powershell/module/microsoft.powershell.core/about/about_remote_jobs)
+ - [about_Thread_Jobs](/powershell/module/microsoft.powershell.core/about/about_thread_jobs)
+
+- GitHub stats
+ - 50 PRs merged (8 from Community)
+ - 55 issues opened (45 from Community)
+ - 51 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filing
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| | :--: | :--: |
+| AlanFlorance | 1 | |
+| gilbertbw | 1 | |
+| ianwalkeruk | 1 | |
+| JeremyTBradshaw | 1 | |
+| matt9ucci | 1 | |
+| Rob-S | 1 | |
+| ShaydeNofziger | 1 | |
+| skycommand | 1 | |
+| juvtib | | 8 |
+| iRon7 | | 2 |
+| l-ip | | 2 |
+| stephenrgentry | | 2 |
+| Vixb1122 | | 2 |
+
+## 2020-October Highlights
+
+- New articles
+ - [about_Character_Encoding](/powershell/module/microsoft.powershell.core/about/about_character_encoding)
+ - [about_Output_Streams](/powershell/module/microsoft.powershell.core/about/about_output_streams)
+ - [Using Visual Studio Code to debug compiled cmdlets](/powershell/scripting/dev-cross-plat/vscode/using-vscode-for-debugging-compiled-cmdlets) (thanks @fsackur)
+ - [Add Credential support to PowerShell functions](/powershell/scripting/learn/deep-dives/add-credentials-to-powershell-functions) (thanks @joshduffney)
+
+- Documentation maintenance
+ - Updates for 7.1-rc content
+ - Updated all article descriptions to improve SEO
+
+- GitHub stats
+ - 61 PRs merged (7 from Community)
+ - 49 issues opened (42 from Community)
+ - 61 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filing
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| | :--: | :--: |
+| doctordns | 1 | |
+| escape208 | 1 | |
+| nickdevore | 1 | |
+| fsackur | 1 | |
+| Duffney | 1 | |
+| skycommand | 1 | |
+| yecril71pl | 1 | |
+| mklement0 | | 3 |
+| Abdullah0820 | | 2 |
+
+## 2020-September Highlights
+
+- Documentation maintenance
+ - Updates for 7.1-preview content
+
+- Community presentation
+ - How to contribute to Docs for RTPUG - https://www.youtube.com/watch?v=0_DEB61YOMc
+
+- GitHub stats
+ - 41 PRs merged (9 from Community)
+ - 52 issues opened (47 from Community)
+ - 51 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filing
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| - | :--: | :--: |
+| doctordns | 1 | |
+| fatherjack | 1 | |
+| goforgold | 1 | |
+| jonathanweinberg | 1 | |
+| kvprasoon | 1 | |
+| skycommand | 1 | |
+| springcomp | 1 | |
+| themichaelbender | 1 | |
+| toddryan | 1 | |
+| mklement0 | | 13 |
+| setpeetrike | | 2 |
+
+## 2020-August Highlights
+
+- New PowerShell documentation
+ - [About_Calculated_Properties](/powershell/module/microsoft.powershell.core/about/about_calculated_properties)
+ - [Writing Progress across multiple threads with Foreach Parallel](/powershell/scripting/learn/deep-dives/write-progress-across-multiple-threads)
+- Documentation maintenance
+ - Updates for 7.1-preview content
+
+- GitHub stats
+ - 69 PRs merged (26 from Community)
+ - 68 issues opened (49 from Community)
+ - 58 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filing
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| - | :--: | :--: |
+| sethvs | 10 | 2 |
+| yecril71pl | 10 | |
+| mklement0 | 1 | 7 |
+| springcomp | 1 | 2 |
+| SquirrelAssassin | | 2 |
+| thorstenbutz | | 2 |
+| aetos382 | 1 | |
+| crumdev | 1 | |
+| joshSi | 1 | |
+| kmoad | 1 | |
+
+## 2020-July Highlights
+
+- New PowerShell documentation
+ - Resurrected old [ETS docs](/powershell/scripting/developer/ets/overview) - 7 articles added
+ - Added article about [creating updateable help using PlatyPS](/powershell/scripting/dev-cross-plat/create-help-using-platyps)
+- Documentation maintenance
+ - Updates for 7.1-preview content
+ - Updated page header - simplified menu choices and added a download button
+ - Fixed several `Update-Help` issues
+ - Help for PSDesiredStateConfiguration and ThreadJob modules now downloads
+ - Published updateable help for PowerShell 7.1 preview
+ - Updateable help for PowerShell 5.1 now includes About topics
+
+- GitHub stats
+ - 99 PRs merged (29 from Community)
+ - 51 issues opened (44 from Community)
+ - 71 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filing
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| -- | :--: | :--: |
+| yecril71pl | 10 | 3 |
+| sethvs | 10 | |
+| springcomp | 3 | 2 |
+| txtor | 2 | 1 |
+| baardhermansen | 1 | |
+| skycommand | 1 | |
+| srjennings | 1 | |
+| xtqqczze | 1 | |
+| mklement0 | | 3 |
+| Allexxann | | 2 |
+| sharpninja | | 2 |
+| XuHeng1021 | | 2 |
+
+## 2020-June Highlights
+
+- New PowerShell documentation
+ - Published new [PowerShell 101](../learn/ps101/00-introduction.md) content contributed by Mike F.
+ Robbins
+ - Added two recent blog posts from Rob Holt to the **Scripting and development** docs
+ - [Choosing the right PowerShell NuGet package for your .NET project](/powershell/scripting/dev-cross-plat/choosing-the-right-nuget-package)
+ - [Resolving PowerShell module assembly dependency conflicts](/powershell/scripting/dev-cross-plat/resolving-dependency-conflicts)
+- Documentation maintenance
+ - Archived older content to [https://aka.ms/PSLegacyDocs](https://aka.ms/PSLegacyDocs)
+ - PowerShell Web Access SDK content
+ - PowerShell Workflows SDK content
+ - Updates for 7.1-preview content
+
+- GitHub stats
+ - 83 PRs merged (15 from Community)
+ - 68 issues opened (52 from Community)
+ - 74 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filling
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| - | :--: | :--: |
+| doctordns | 3 | |
+| gabrielmccoll | 2 | |
+| adrianhale | 1 | |
+| aisbergde | 1 | |
+| beatcracker | 1 | |
+| bergmeister | 1 | |
+| DarioArzaba | 1 | |
+| gforceg | 1 | |
+| jpomfret | 1 | |
+| Karl-WE | 1 | |
+| signalwarrant | 1 | |
+| skycommand | 1 | |
+| tkhadimullin | 1 | |
+| johnkberry | | 2 |
+| juvtib | | 2 |
+| mklement0 | | 2 |
+| Sagatboy33 | | 4 |
+
+## 2020-May Highlights
+
+- New PowerShell documentation
+ - Created a new [Deep dives](../learn/deep-dives/overview.md) section containing content from
+ community contributor Kevin Marquette
+ - [Everything you want to know about arrays](../learn/deep-dives/everything-about-arrays.md)
+ - [Everything you want to know about hashtables](../learn/deep-dives/everything-about-hashtable.md)
+ - [Everything you want to know about PSCustomObject](../learn/deep-dives/everything-about-pscustomobject.md)
+ - [Everything you want to know about string substitution](../learn/deep-dives/everything-about-string-substitutions.md)
+ - [Everything you want to know about if/then/else](../learn/deep-dives/everything-about-if.md)
+ - [Everything you want to know about switch](../learn/deep-dives/everything-about-switch.md)
+ - [Everything you want to know about exceptions](../learn/deep-dives/everything-about-exceptions.md)
+ - [Everything you want to know about $null](../learn/deep-dives/everything-about-null.md)
+ - [Everything you want to know about ShouldProcess](../learn/deep-dives/everything-about-shouldprocess.md)
+ - [How to create a Standard Library binary module](../dev-cross-plat/create-standard-library-binary-module.md)
+ - Published the [PowerShell 7.0 .NET API](/dotnet/api/?view=powershellsdk-7.0.0&preserve-view=true)
+ reference
+ - `Update-Help -Force` for PowerShell 5.1 now downloads updated content for the core PowerShell
+ modules
+- Documentation maintenance
+ - Major reorganization of the Table of Contents
+ - New content under **Learning PowerShell**
+ - Windows PowerShell 5.1 content collected in one location
+ - Archived older content to [https://aka.ms/PSLegacyDocs](https://aka.ms/PSLegacyDocs)
+ - PowerShell Web Access
+ - PowerShell Workflows Guide
+ - Updates for 7.1-preview content
+
+- GitHub stats
+ - 81 PRs merged (21 from Community)
+ - 61 issues opened (53 from Community)
+ - 64 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filling
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| -- | :--: | :--: |
+| nschonni | 10 | |
+| xtqqczze | 2 | 1 |
+| kilasuit | 1 | 1 |
+| davidseibel | 1 | |
+| doctordns | 1 | |
+| jhoffmann271 | 1 | |
+| KevinMarquette | 1 | |
+| klitztuch | 1 | |
+| markojorge | 1 | |
+| perjahn | 1 | |
+| schuelermine | 1 | |
+| jsilverm | | 7 |
+| mklement0 | | 5 |
+| cam1170 | | 2 |
+| JustinGrote | | 2 |
+| peetrike | | 2 |
+
+## 2020-April Highlights
+
+- New documents
+ - PowerShell documentation
+ - [Using Experimental Features](/powershell/scripting/whats-new/experimental-features)
+ - [about_PSModulePath](/powershell/module/microsoft.powershell.core/about/about_psmodulepath)
+ - Wiki articles
+ - [The case for and against Invoke-Expression](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/The-case-for-and-against-Invoke-Expression)
+ - [Variables can be assigned values as part of an expression (with limitations)](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/Variables-can-be-assigned-values-as-part-of-an-expression-(with-limitations))
+
+- Documentation maintenance
+ - Now publishing updates to docs.microsoft.com on a daily schedule
+ - Monday-Friday 3pm Redmond Time (UTC-8)
+ - Restructured the Community content
+ - Many editorial cleanups
+ - Updated Contributor Guide
+ - Clarified some formatting rules
+ - New information about table formatting
+
+- GitHub stats
+ - 74 PRs merged (8 from Community)
+ - 79 issues opened (71 from Community)
+ - 102 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filling
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| - | :--: | :--: |
+| ScSurber | 1 | 1 |
+| alexandair | 1 | |
+| bmkaiser | 1 | |
+| hyoshioka0128 | 1 | |
+| jpomfret | 1 | |
+| raydixon | 1 | |
+| signalwarrant | 1 | |
+| mklement0 | | 8 |
+| reinierk | | 3 |
+| scabon | | 2 |
+| Abdullah0820 | | 2 |
+| awooga | | 2 |
+| Damag3d | | 2 |
+| Fiasco123 | | 2 |
+| Jasonthurston | | 2 |
+
+## 2020-March
+
+### Highlights
+
+- New documents
+ - The PowerShell Docs community pages
+ - [Community resources](/powershell/scripting/community/community-support) page
+ - [What's new in PowerShell Docs](#2020-march) page (this page)
+ - [PowerShell Infographic](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/assets/PowerShell_7_Infographic.pdf)
+ added to the Digital Art page
+ - [PowerShell-Doc contributor guide](/powershell/scripting/community/contributing/overview)
+ - New PowerShell content
+ - [Migrating from Windows PowerShell 5.1 to PowerShell 7](/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7)
+ - [PowerShell 7 module compatibility list](/PowerShell/scripting/whats-new/module-compatibility)
+ - [Using PowerShell in Docker](/powershell/scripting/install/powershell-in-docker)
+ - New Wiki content
+ - [PowerShell prevents exceptions for non existent keys for types that implement IDictionary TKey, TValue](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/PowerShell-prevents-exceptions-for-non-existent-keys-for-types-that-implement-IDictionary-TKey,-TValue-)
+ - [PowerShell's treatment of namespaces is case insensitive but case preserving](https://github.com/MicrosoftDocs/PowerShell-Docs/wiki/PowerShell's-treatment-of-namespaces-is-case-insensitive-but-case-preserving)
+
+- Documentation maintenance
+ - Massive cleanup of broken links
+ - Cleanup of old and duplicate issues
+
+- GitHub stats
+ - 100 PRs merged (14 from Community)
+ - 68 issues opened (56 from Community)
+ - 109 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filling
+issues. Thank you!
+
+- k-takai - 7 PRs
+- mklement0 - 5 issues
+- juvtib - 4 issues
+- iSazonov - 3 issue
+- doctordns - 2 issues
+- mdorantesm - 2 issues
+- qt3m45su0najc7 - 2 issues
+
+## 2020-February
+
+### Highlights
+
+- New documents
+ - [about_Parameter_Sets](/powershell/module/microsoft.powershell.core/about/about_parameter_sets)
+ - [Release history of modules and cmdlets](/powershell/scripting/whats-new/cmdlet-versions)
+- PowerShell 7 documentation updates
+- Updates to address issues
+- Ran PlatyPS to verify parameter info for all cmdlets and versions
+- GitHub stats
+ - 52 PRs merged (9 from Community)
+ - 49 issues opened (42 from Community)
+ - 55 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filling
+issues. Thank you!
+
+- Maamue - 2 PRs
+- doctordns - 2 PRs
+- mklement0 - 4 issues
+- he852100 - 3 issues
+- VectorBCO - 2 issues
+- metablaster - 2 issues
+
+## 2020-January
+
+### Highlights
+
+- New documents
+ - [about_Windows_PowerShell_Compatibility](/powershell/module/microsoft.powershell.core/about/about_Windows_PowerShell_Compatibility)
+- PowerShell 7 documentation updates
+- Updates to address issues
+- GitHub stats
+ - 58 PRs merged (7 from Community)
+ - 57 issues opened (43 from Community)
+ - 70 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filling
+issues. Thank you!
+
+- Makovec - 3 PRs
+- mklement0 - 9 issues
+- mvadu - 2 issues
+- razos - 2 issues
+- VLoub - 2 issues
+- doctordns - 2 issues
community https://docs.microsoft.com/en-us/powershell/scripting/community/2021-updates https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/community/2021-updates.md
@@ -0,0 +1,46 @@
+
+ Title: What's New in PowerShell Docs for 2020-Q1
+description: List of changes to the PowerShell documentation for 2020-Q1
Last updated : 02/01/2021++
+# What's new in PowerShell Docs for 2021-Q1
+
+This article lists some of the major changes to docs during this previous month and celebrates the
+contributions from the community.
+
+Help us make the documentation better for you. Read the [Contributor's Guide][contrib] to learn how
+to get started.
+
+## 2021-January
+
+### Highlights
+
+- PowerShell 7.2-preview documentation updates
+- GitHub stats
+ - 44 PRs merged (14 from Community)
+ - 46 issues opened (38 from Community)
+ - 45 issues closed
+
+### Top Community Contributors
+
+The following people have contributed to PowerShell docs by submitting pull requests or filing
+issues. Thank you!
+
+| GitHub Id | PRs merged | Issues opened |
+| -- | :--: | :--: |
+| AndreyMatrosov | 4 | |
+| revolter | 2 | |
+| cconrad | 1 | |
+| Hrxn | 1 | |
+| kilasuit | 1 | |
+| NN | 1 | |
+| snickler | 1 | |
+| vinian | 1 | |
+| zeekbrown | 1 | |
+| brianary | | 2 |
+| mklement0 | | 2 |
+| plastikfan | | 2 |
+
+<!-- Link references -->
+[contrib]: contributing/overview.md
community https://docs.microsoft.com/en-us/powershell/scripting/community/hall-of-fame https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/community/hall-of-fame.md
@@ -1,7 +1,7 @@
Title: Community contributor Hall of Fame description: List of the GitHub users that have the most contributions to the PowerShell-Doc project. Previously updated : 12/02/2020 Last updated : 02/01/2021 # Community Contributor Hall of Fame
@@ -15,44 +15,45 @@ As of the end of May 2020, these GitHub users are the All-Time Top Community Con
Pull Requests help us fix those issues and make the documentation better for everyone.
-| Docs PRs Merged | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | Grand Total |
-| | : | : | : | : | : | : | -: |
-| Community | 3 | 198 | 448 | 468 | 322 | 162 | 1601 |
-| matt9ucci | | | 157 | 80 | 30 | 1 | 268 |
-| nschonni | | | | 14 | 138 | 10 | 162 |
-| kiazhi | | 25 | 79 | 12 | | | 116 |
-| alexandair | | 59 | 8 | 26 | 2 | 1 | 96 |
-| doctordns | | 5 | 32 | 20 | 7 | 9 | 73 |
-| sethvs | | | 1 | 44 | | 20 | 65 |
-| yecril71pl | | | | | | 21 | 21 |
-| Dan1el42 | | 20 | | | | | 20 |
-| NReilingh | | 2 | | 13 | 3 | | 18 |
-| it-praktyk | | | | 16 | 1 | | 17 |
-| markekraus | | | 11 | 5 | | | 16 |
-| kvprasoon | | 2 | 1 | 7 | 2 | 2 | 14 |
-| purdo17 | | | | 13 | | | 13 |
-| skycommand | | | 1 | 3 | 3 | 6 | 13 |
-| k-takai | | | | 5 | 1 | 7 | 13 |
-| PlagueHO | | 10 | | | 1 | | 11 |
-| KirkMunro | | 1 | 1 | 2 | 6 | | 10 |
-| exchange12rocks | | | 7 | 3 | | | 10 |
+| Docs PRs Merged | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | Grand Total |
+| | : | : | : | : | : | : | : | -: |
+| Community | 3 | 198 | 448 | 468 | 322 | 162 | 14 | 1615 |
+| matt9ucci | | | 157 | 80 | 30 | 1 | | 268 |
+| nschonni | | | | 14 | 138 | 10 | | 162 |
+| kiazhi | | 25 | 79 | 12 | | | | 116 |
+| alexandair | | 59 | 8 | 26 | 2 | 1 | | 96 |
+| doctordns | | 5 | 32 | 20 | 7 | 9 | | 73 |
+| sethvs | | | 1 | 44 | | 20 | | 65 |
+| yecril71pl | | | | | | 21 | | 21 |
+| Dan1el42 | | 20 | | | | | | 20 |
+| NReilingh | | 2 | | 13 | 3 | | | 18 |
+| it-praktyk | | | | 16 | 1 | | | 17 |
+| markekraus | | | 11 | 5 | | | | 16 |
+| kvprasoon | | 2 | 1 | 7 | 2 | 2 | | 14 |
+| purdo17 | | | | 13 | | | | 13 |
+| k-takai | | | | 5 | 1 | 7 | | 13 |
+| skycommand | | | 1 | 3 | 3 | 6 | | 13 |
+| PlagueHO | | 10 | | | 1 | | | 11 |
+| exchange12rocks | | | 7 | 3 | | | | 10 |
+| KirkMunro | | 1 | 1 | 2 | 6 | | | 10 |
## GitHub issues opened GitHub issues help us identify errors and gaps in our documentation.
-| Docs Issues Opened | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | Grand Total |
-| | : | : | : | : | : | : | -: |
-| Community | 3 | 54 | 95 | 213 | 575 | 584 | 1529 |
-| mklement0 | | | 19 | 60 | 56 | 61 | 196 |
-| jszabo98 | | | | 2 | 15 | 6 | 23 |
-| iSazonov | | | 1 | 4 | 10 | 8 | 23 |
-| doctordns | | | 5 | 3 | 5 | 7 | 20 |
-| KirkMunro | | | | 7 | 7 | 1 | 15 |
-| juvtib | | | | | | 15 | 15 |
-| alexandair | | 9 | 4 | 2 | | | 15 |
-| vexx32 | | | | 3 | 11 | | 14 |
-| JustinGrote | | | | 1 | 3 | 6 | 10 |
+| Docs Issues Opened | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | Grand Total |
+| | : | : | : | : | : | : | : | -: |
+| Community | 3 | 54 | 95 | 213 | 575 | 584 | 38 | 1562 |
+| mklement0 | | | 19 | 60 | 56 | 61 | 2 | 198 |
+| jszabo98 | | | | 2 | 15 | 6 | | 23 |
+| iSazonov | | | 1 | 4 | 10 | 8 | | 23 |
+| doctordns | | | 5 | 3 | 5 | 7 | | 20 |
+| KirkMunro | | | | 7 | 7 | 1 | | 15 |
+| juvtib | | | | | | 15 | | 15 |
+| alexandair | | 9 | 4 | 2 | | | | 15 |
+| vexx32 | | | | 3 | 11 | | | 14 |
+| vors | 1 | 6 | 2 | 1 | | | | 10 |
+| JustinGrote | | | | 1 | 3 | 6 | | 10 |
<!-- Link references --> [contrib]: contributing/overview.md
developer https://docs.microsoft.com/en-us/powershell/scripting/developer/hosting/adding-and-invoking-commands https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/developer/hosting/adding-and-invoking-commands.md
@@ -113,7 +113,7 @@ is already a script named `MyScript.ps1` in a folder named `D:\PSScripts`.
```csharp PowerShell ps = PowerShell.Create();
-ps.AddScript("D:\PSScripts\MyScript.ps1").Invoke();
+ps.AddScript(File.ReadAllText(@"D:\PSScripts\MyScript.ps1")).Invoke();
``` There is also a version of the
@@ -124,7 +124,7 @@ scope.
```csharp PowerShell ps = PowerShell.Create();
-ps.AddScript(@"D:\PSScripts\MyScript.ps1", true).Invoke();
+ps.AddScript(File.ReadAllText(@"D:\PSScripts\MyScript.ps1"), true).Invoke();
``` ### Invoking a pipeline synchronously
gallery https://docs.microsoft.com/en-us/powershell/scripting/gallery/faqs https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/gallery/faqs.md
@@ -1,269 +0,0 @@
- Previously updated : 06/12/2017 Title: PowerShell Gallery FAQs
-description: Frequently asked questions about the PowerShell Gallery
-
-# Frequently asked questions about the PowerShell Gallery
-
-## What is a PowerShell module?
-
-A PowerShell module is a reusable package containing some PowerShell functionality. Everything in
-PowerShell (functions, variables, DSC resources, etc.) can be packaged in modules. Typically,
-modules are folders containing specific types of files stored on a specific path. There are a few
-different types of PowerShell modules out there.
-
-## What is a PowerShell script?
-
-A PowerShell script is a series of commands that are stored in a .ps1 file to enable reuse and
-sharing. PowerShell workflows are also PowerShell scripts, which outline a set of tasks and provide
-sequencing for those tasks. For more information, please visit
-[Getting Started with PowerShell Workflow](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/jj134242(v=ws.11)).
-
-## How are PowerShell Scripts different from PowerShell Modules?
-
-Modules are generally better for sharing, but we are enabling script sharing to make it easier for
-you to contribute workflows and scripts to the community. For more information, see the following
-blogs:
--- [Don't Write Scripts, Write PowerShell Modules](https://devblogs.microsoft.com/scripting/dont-write-scripts-write-powershell-modules/)-- [Understanding PowerShell Modules](https://devblogs.microsoft.com/scripting/understanding-powershell-modules/)-
-## How can I publish to the PowerShell Gallery?
-
-You must register an account in the PowerShell Gallery before you can publish packages to the
-Gallery. This is because publishing packages requires a NuGetApiKey, which is provided upon
-registration. To register, use your personal, work, or school account to sign in to the PowerShell
-Gallery. A one-time registration process is required when you sign in for the first time.
-Afterwards, your NuGetApiKey is available on your profile page.
-
-Once you have registered in the Gallery, use the [Publish-Module][] or [Publish-Script][] cmdlets to
-publish your package to the Gallery. For more details on how to run these cmdlets, visit the Publish
-tab, or read the [Publish-Module][] and [Publish-Script][] documentation.
-
-**You do not need to register or sign in to the Gallery to install or save packages.**
-
-## I received "Failed to process request. 'The specified API key is invalid or does not have permission to access the specified package.'. The remote server returned an error: (403) Forbidden." error when I tried to publish a package to the PowerShell Gallery. What does that mean?
-
-This error can occur for the following reasons:
--- **The specified API key is invalid.** Ensure that you have specified the valid API key from your
- account. To get your API key, view your profile page.
-- **The specified package name is not owned by you.** If you have confirmed that your API key is
- correct, then there may already exist a package with the same name as the one you are trying to
- use. The package may have been unlisted by the owner, in which case it will not appear in any
- search results. To determine if a package with the same name already exists, open a browser and
- navigate to the package's details page:
- `https://www.powershellgallery.com/packages/<packageName>`. For example, navigating directly to
- `https://www.powershellgallery.com/packages/pester` will take you to the Pester module's details
- page, whether it is unlisted or not. If a package with a conflicting name already exists and is
- unlisted, you can:
- - Select another name for your package.
- - Contact the owners of the existing package.
-
-## Why can't I sign in with my personal account, but I could sign in yesterday?
-
-Please be aware that your gallery account does not accommodate changes to your primary email alias.
-For more information, see
-[Microsoft Email Aliases](https://windows.microsoft.com/windows/outlook/add-alias-account).
-
-## Why don't I see all the gallery packages when I select all the Category checkboxes on the packages tab?
-
-By selecting a Category checkbox, you are stating "I would like to see all packages in this
-category." Only the packages in the selected categories will be displayed. So similarly, by
-selecting all the Category checkboxes, you are stating "I would like to see all packages in any
-category." But some packages in the gallery do not belong to any of the categories listed, so they
-will not appear in the results. To see all packages in the gallery, uncheck all the Categories, or
-select the packages tab again.
-
-## What are the requirements to publish a module to the PowerShell Gallery?
-
-Any kind of PowerShell module (script modules, binary modules, or manifest modules) can be published
-to the gallery. To publish a module, PowerShellGet needs to know a few things about it - the
-version, description, author, and how it is licensed. This information is read as part of the
-publishing process from the *module manifest* (.psd1) file, or from the value of the
-[Publish-Module][] cmdlet's **LicenseUri** parameter. All modules published to the Gallery must have
-module manifests. Any module that includes the following information in its manifest can be
-published to the Gallery:
--- Version-- Description-- Author-- A URI to the license terms of the module, either as part of the **PrivateData** section of the
- manifest, or in the **LicenseUri** parameter of the [Publish-Module][] cmdlet.
-
-## How do I create a correctly-formatted module manifest?
-
-The easiest way to create a module manifest is to run the [New-ModuleManifest][] cmdlet. In
-PowerShell 5.0 or newer, New-ModuleManifest generates a correctly-formatted module manifest with
-blank fields for useful metadata like **ProjectUri**, **LicenseUri**, and **Tags**. Simply fill in
-the blanks, or use the generated manifest as an example of correct formatting.
-
-To verify that all required metadata fields have been properly filled, use the
-[Test-ModuleManifest][] cmdlet.
-
-To update the module manifest file fields, use the [Update-ModuleManifest][] cmdlet.
-
-## What are the requirements to publish a script to the Gallery?
-
-Any kind of PowerShell script (scripts or workflows) can be published to the gallery. To publish a
-script, PowerShellGet needs to know a few things about it - the version, description, author, and
-how it is licensed. This information is read as part of the publishing process from the script
-file's *PSScriptInfo* section, or from the value of the [Publish-Script][] cmdlet's **LicenseUri**
-parameter. All scripts published to the Gallery must have metadata information. Any script that
-includes the following information in its PSScriptInfo section can be published to the Gallery:
--- Version-- Description-- Author-- A URI to the license terms of the script, either as part of the **PSScriptInfo** section of the
- script, or in the **LicenseUri** parameter of the [Publish-Script][] cmdlet.
-
-## How do I search?
-
-Type what you are looking for in the text box. For example, if you want to find modules that are
-related to Azure SQL, just type "azure sql". Our search engine will look for those keywords in all
-published packages, including titles, descriptions and across metadata. Then, based on a weighted
-quality score, it will display the closest matches. You can also search by specific field using
-field:"value" syntax in the search query for the following fields:
--- Tags-- Functions-- Cmdlets-- DscResources-- PowerShellVersion-
-So, for example, when you search for PowerShellVersion:"2.0" only results that are compatible with
-PowerShellVersion 2.0 (based on their module/script manifest) will be displayed.
-
-## How do I create a correctly-formatted script file?
-
-The easiest way to create a properly-formatted script file is to run the [New-ScriptFileInfo][]
-cmdlet. In PowerShell 5.0, New-ScriptFileInfo generates a correctly-formatted script file with blank
-fields for useful metadata like **ProjectUri**, **LicenseUri**, and **Tags**. Simply fill in the
-blanks, or use the generated script file as an example of correct formatting.
-
-To verify that all required metadata fields have been properly filled, use the
-[Test-ScriptFileInfo][] cmdlet.
-
-To update the script metadata fields, use the [Update-ScriptFileInfo][] cmdlet.
-
-## What other types of PowerShell Modules exist?
-
-The term PowerShell module also refers to the files that implement actual functionality. Script
-module files (.psm1) contain PowerShell code. Binary module files (.dll) contain compiled code.
-
-Here is one way to think about it: the folder that encapsulates the module is the module folder. The
-module folder can contain a module manifest (.psd1) that describes the contents of the folder. The
-files that actually do the work are the script module files (.psm1) and the binary module files
-(.dll). DSC resources are located in a specific sub-folder, and are implemented as script module
-files or binary module files.
-
-All of the modules in the Gallery contain module manifests, and most of these modules contain script
-module files or binary module files. The term module can be confusing because of these different
-meanings. Unless explicitly stated otherwise, all uses of the word module on this page refer to the
-module folder containing these files.
-
-## How does PackageManagement relate to PowerShellGet? (High Level Answer)
-
-PackageManagement is a common interface for working with any package manager. Eventually, whether
-you're dealing with PowerShell modules, MSIs, Ruby gems, NuGet packages, or Perl modules, you should
-be able to use PackageManagement's commands (Find-Package and Install-Package) to find and install
-them. PackageManagement does this by having a package provider for each package manager that plugs
-into PackageManagement. Providers do all of the actual work; they fetch content from repositories,
-and install the content locally. Often, package providers simply wrap around the existing package
-manager tools for a given package type.
-
-PowerShellGet is the package manager for PowerShell packages. There is a PSModule package provider
-that exposes PowerShellGet functionality through PackageManagement. Because of this, you can either
-run [Install-Module][] or Install-Package -Provider PSModule to install a module from the PowerShell
-Gallery. Certain PowerShellGet functionality, including [Update-Module][] and [Publish-Module][],
-cannot be accessed through PackageManagement commands.
-
-In summary, PowerShellGet is solely focused on having a premium package management experience for
-PowerShell content. PackageManagement is focused on exposing all package management experiences
-through one general set of tools. If you find this answer unsatisfying, there is a long answer at
-the bottom of this document, in the **How does PackageManagement actually relate to PowerShellGet?**
-section.
-
-For more information, please visit the [PackageManagement project page](https://oneget.org/).
-
-## How does NuGet relate to PowerShellGet?
-
-The PowerShell Gallery is a modified version of the [NuGet Gallery](https://www.nuget.org/).
-PowerShellGet uses NuGet provider to work with NuGet based repositories like the PowerShell Gallery.
-
-You can use PowerShellGet against any valid NuGet repository or file share. You simply need to add
-the repository by running the [Register-PSRepository][] cmdlet.
-
-## Does that mean I can use NuGet.exe to work with the Gallery?
-
-Yes.
-
-## How does PackageManagement actually relate to PowerShellGet? (Technical Details)
-
-Under the hood, PowerShellGet heavily leverages PackageManagement infrastructure.
-
-At the PowerShell cmdlet layer, [Install-Module][] is actually a thin wrapper around
-`Install-Package -Provider PSModule`.
-
-At the PackageManagement package provider layer, the PSModule package provider actually calls into
-other PackageManagement package providers. For example, when you are working with NuGet-based
-galleries (such as the PowerShell Gallery), the PSModule package provider uses the NuGet Package
-Provider to work with the repository.
-
-![Diagram of the PowerShellGet Architecture](media/faqs/powershellgetArchitecture.png)
-
-Figure 1: PowerShellGet Architecture
-
-## What is required to run PowerShellGet?
-
-In general we recommend picking the latest version of PowerShellGet module (note that it requires
-.NET 4.5).
-
-The **PowerShellGet** module requires **PowerShell 3.0 or newer**.
-
-Therefore, **PowerShellGet** requires one of the following operating systems:
--- Windows 10-- Windows 8.1 Pro-- Windows 8.1 Enterprise-- Windows 7 SP1-- Windows Server 2016-- Windows Server 2012 R2-- Windows Server 2008 R2 SP1-
-**PowerShellGet** also requires .NET Framework 4.5 or above. For more information, see
-[Install the .NET Framework for developers](/dotnet/framework/install/guide-for-developers).
-
-## Is it possible to reserve names for packages that will be published in future?
-
-It is not possible to squat package names. If you feel that an existing package has taken the name
-which suits your package more, try
-[contacting the owner of the package](./how-to/working-with-packages/contacting-package-owners.md).
-If you didn't get response within a couple of weeks, you can contact support and the PowerShell
-Gallery team will look in to it.
-
-## How do I claim ownership for packages?
-
-Check out [Managing Package Owners on PowerShellGallery.com](./how-to/publishing-packages/managing-package-owners.md)
-for details.
-
-## How do I deal with a package owner who is violating my package license?
-
-We encourage the PowerShell community to work together to resolve any disputes that may arise
-between package owners and the owners of other packages. We have crafted a
-[dispute resolution process](./how-to/getting-support/dispute-resolution.md) that we ask you to
-follow before PowerShellGallery.com administrators intercede.
-
-<!-- link references-->
-[New-ModuleManifest]: /powershell/module/Microsoft.PowerShell.Core/New-ModuleManifest
-[Test-ModuleManifest]: /powershell/module/Microsoft.PowerShell.Core/Test-ModuleManifest
-[Update-ModuleManifest]: /powershell/module/PowerShellGet/Update-ModuleManifest
-[Install-Module]: /powershell/module/PowershellGet/Install-Module
-[New-ScriptFileInfo]: /powershell/module/PowershellGet/New-ScriptFileInfo
-[Publish-Module]: /powershell/module/PowershellGet/Publish-Module
-[Publish-Script]: /powershell/module/PowershellGet/Publish-Script
-[Register-PSRepository]: /powershell/module/PowershellGet/Register-PSRepository
-[Test-ScriptFileInfo]: /powershell/module/PowershellGet/Test-ScriptFileInfo
-[Update-Module]: /powershell/module/PowershellGet/Update-Module
-[Update-ScriptFileInfo]: /powershell/module/PowershellGet/Update-ScriptFileInfo
install https://docs.microsoft.com/en-us/powershell/scripting/install/Installing-PowerShell-Core-on-Linux https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/install/Installing-PowerShell-Core-on-Linux.md
@@ -1,7 +1,7 @@
Title: Installing PowerShell on Linux description: Information about installing PowerShell on various Linux distributions Previously updated : 12/10/2020 Last updated : 02/02/2021 # Installing PowerShell on Linux
@@ -96,13 +96,13 @@ PowerShell with `sudo apt-get install powershell`.
### Installation via Direct Download - Ubuntu 16.04
-Download the Debian package `powershell_7.1.0-1.ubuntu.16.04_amd64.deb` from the [releases][] page
+Download the Debian package `powershell_7.1.1-1.ubuntu.16.04_amd64.deb` from the [releases][] page
onto the Ubuntu machine. Then, in the terminal, execute the following commands: ```sh
-sudo dpkg -i powershell_7.1.0-1.ubuntu.16.04_amd64.deb
+sudo dpkg -i powershell_7.1.1-1.ubuntu.16.04_amd64.deb
sudo apt-get install -f ```
@@ -148,13 +148,13 @@ PowerShell with `sudo apt-get install powershell`.
### Installation via Direct Download - Ubuntu 18.04
-Download the Debian package `powershell_7.1.0-1.ubuntu.18.04_amd64.deb` from the [releases][] page
+Download the Debian package `powershell_7.1.1-1.ubuntu.18.04_amd64.deb` from the [releases][] page
onto the Ubuntu machine. Then, in the terminal, execute the following commands: ```sh
-sudo dpkg -i powershell_7.1.0-1.ubuntu.18.04_amd64.deb
+sudo dpkg -i powershell_7.1.1-1.ubuntu.18.04_amd64.deb
sudo apt-get install -f ```
@@ -200,13 +200,13 @@ PowerShell with `sudo apt-get install powershell`.
### Installation via Direct Download - Ubuntu 20.04
-Download the Debian package `powershell_7.1.0-1.ubuntu.20.04_amd64.deb` from the [releases][] page
+Download the Debian package `powershell_7.1.1-1.ubuntu.20.04_amd64.deb` from the [releases][] page
onto the Ubuntu machine. Then, in the terminal, execute the following commands: ```sh
-sudo dpkg -i powershell_7.1.0-1.ubuntu.20.04_amd64.deb
+sudo dpkg -i powershell_7.1.1-1.ubuntu.20.04_amd64.deb
sudo apt-get install -f ```
@@ -302,13 +302,13 @@ with `sudo apt-get install powershell`.
### Installation via Direct Download - Debian 9
-Download the Debian package `powershell_7.1.0-1.debian.9_amd64.deb` from the [releases][] page
+Download the Debian package `powershell_7.1.1-1.debian.9_amd64.deb` from the [releases][] page
onto the Debian machine. Then, in the terminal, execute the following commands: ```sh
-sudo dpkg -i powershell_7.1.0-1.debian.9_amd64.deb
+sudo dpkg -i powershell_7.1.1-1.debian.9_amd64.deb
sudo apt-get install -f ```
@@ -348,7 +348,7 @@ pwsh
### Installation via Direct Download - Debian 10
-Download the tar.gz package `powershell-7.1.0-linux-x64.tar.gz` from the [releases][] page
+Download the tar.gz package `powershell-7.1.1-linux-x64.tar.gz` from the [releases][] page
onto the Debian machine. Then, in the terminal, execute the following commands:
@@ -371,7 +371,7 @@ sudo apt-get install -y \
curl # Download the powershell '.tar.gz' archive
-curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz
+curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-linux-x64.tar.gz -o /tmp/powershell.tar.gz
# Create the target folder where powershell will be placed sudo mkdir -p /opt/microsoft/powershell/7
@@ -396,7 +396,7 @@ pwsh
### Installation via Direct Download - Alpine 3.9 and 3.10
-Download the tar.gz package `powershell-7.1.0-linux-alpine-x64.tar.gz` from the [releases][] page onto
+Download the tar.gz package `powershell-7.1.1-linux-alpine-x64.tar.gz` from the [releases][] page onto
the Alpine machine. Then, in the terminal, execute the following commands:
@@ -422,7 +422,7 @@ sudo apk -X https://dl-cdn.alpinelinux.org/alpine/edge/main add --no-cache \
lttng-ust # Download the powershell '.tar.gz' archive
-curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-linux-alpine-x64.tar.gz -o /tmp/powershell.tar.gz
+curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-linux-alpine-x64.tar.gz -o /tmp/powershell.tar.gz
# Create the target folder where powershell will be placed sudo mkdir -p /opt/microsoft/powershell/7
@@ -466,19 +466,19 @@ with `sudo yum update powershell`.
### Installation via Direct Download - CentOS 7
-Using [CentOS 7][], download the RPM package `powershell-7.1.0-1.rhel.7.x86_64.rpm` from the [releases][]
+Using [CentOS 7][], download the RPM package `powershell-7.1.1-1.rhel.7.x86_64.rpm` from the [releases][]
page onto the CentOS machine. Then, in the terminal, execute the following commands: ```sh
-sudo yum install powershell-7.1.0-1.rhel.7.x86_64.rpm
+sudo yum install powershell-7.1.1-1.rhel.7.x86_64.rpm
``` You can install the RPM without the intermediate step of downloading it: ```sh
-sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-1.rhel.7.x86_64.rpm
+sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-1.rhel.7.x86_64.rpm
``` ### Uninstallation - CentOS 7
@@ -512,19 +512,19 @@ with `sudo yum update powershell`.
### Installation via Direct Download - Red Hat Enterprise Linux (RHEL) 7
-Download the RPM package `powershell-7.1.0-1.rhel.7.x86_64.rpm` from the [releases][] page onto
+Download the RPM package `powershell-7.1.1-1.rhel.7.x86_64.rpm` from the [releases][] page onto
the Red Hat Enterprise Linux machine. Then, in the terminal, execute the following commands: ```sh
-sudo yum install powershell-7.1.0-1.rhel.7.x86_64.rpm
+sudo yum install powershell-7.1.1-1.rhel.7.x86_64.rpm
``` You can install the RPM without the intermediate step of downloading it: ```sh
-sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-1.rhel.7.x86_64.rpm
+sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-1.rhel.7.x86_64.rpm
``` ### Uninstallation - Red Hat Enterprise Linux (RHEL) 7
@@ -542,7 +542,7 @@ sudo yum remove powershell
zypper update && zypper --non-interactive install curl tar libicu52_1 # Download the powershell '.tar.gz' archive
-curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz
+curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-linux-x64.tar.gz -o /tmp/powershell.tar.gz
# Create the target folder where powershell will be placed mkdir -p /opt/microsoft/powershell/7
@@ -567,7 +567,7 @@ pwsh
zypper update && zypper --non-interactive install curl tar gzip libopenssl1_0_0 libicu60_2 # Download the powershell '.tar.gz' archive
-curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-linux-x64.tar.gz -o /tmp/powershell.tar.gz
+curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-linux-x64.tar.gz -o /tmp/powershell.tar.gz
# Create the target folder where powershell will be placed mkdir -p /opt/microsoft/powershell/7
@@ -626,21 +626,21 @@ pwsh
### Installation via Direct Download - Fedora 28, 29, and 30
-Download the RPM package `powershell-7.1.0-1.rhel.7.x86_64.rpm` from the [releases][] page onto the
+Download the RPM package `powershell-7.1.1-1.rhel.7.x86_64.rpm` from the [releases][] page onto the
Fedora machine. Then, in the terminal, execute the following commands: ```sh sudo dnf install compat-openssl10
-sudo dnf install powershell-7.1.0-1.rhel.7.x86_64.rpm
+sudo dnf install powershell-7.1.1-1.rhel.7.x86_64.rpm
``` You can install the RPM without the intermediate step of downloading it: ```sh sudo dnf install compat-openssl10
-sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-1.rhel.7.x86_64.rpm
+sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-1.rhel.7.x86_64.rpm
``` ### Uninstallation - Fedora 28, 29, and 30
@@ -771,13 +771,13 @@ sudo apt-get install '^libssl1.0.[0-9]$' libunwind8 -y
# Download and extract PowerShell # Grab the latest tar.gz
-wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-linux-arm32.tar.gz
+wget https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-linux-arm32.tar.gz
# Make folder to put powershell mkdir ~/powershell # Unpack the tar.gz file
-tar -xvf ./powershell-7.1.0-linux-arm32.tar.gz -C ~/powershell
+tar -xvf ./powershell-7.1.1-linux-arm32.tar.gz -C ~/powershell
# Start PowerShell ~/powershell/pwsh
@@ -869,7 +869,7 @@ Linux `tar.gz` archive.
```sh # Download the powershell '.tar.gz' archive
-curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-linux-x64.tar.gz
+curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-linux-x64.tar.gz
# Create the target folder where powershell will be placed sudo mkdir -p /opt/microsoft/powershell/7
@@ -912,7 +912,7 @@ installation available from other sources. While those tools and methods may wor
support those methods. <!-- link references -->
-[releases]: https://github.com/PowerShell/PowerShell/releases/latest
+[releases]: https://aka.ms/PowerShell-Release?tag=stable
[xdg-bds]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html [distros]: https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#linux [Distribution Support Request]: https://github.com/PowerShell/PowerShell/issues/new?assignees=&labels=Distribution-Request&template=Distribution_Request.md&title=Distribution+Support+Request
install https://docs.microsoft.com/en-us/powershell/scripting/install/Installing-PowerShell-Core-on-Windows https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/install/Installing-PowerShell-Core-on-Windows.md
@@ -1,7 +1,7 @@
Title: Installing PowerShell on Windows description: Information about installing PowerShell on Windows Previously updated : 11/11/2020 Last updated : 02/02/2021 # Installing PowerShell on Windows
@@ -21,17 +21,16 @@ To enable PowerShell remoting over WSMan, the following prerequisites need to be
## Download the installer package
-To install PowerShell on Windows, download the [latest][] install package from GitHub. You can
-also find the latest preview version on the [releases][] page. Scroll down to the **Assets**
-section of the Release page. The **Assets** section may be collapsed, so you may need to click
-to expand it.
+To install PowerShell on Windows, download the [latest][] install package from GitHub. You can also
+find the latest [preview][] version. Scroll down to the **Assets** section of the Release page. The
+**Assets** section may be collapsed, so you may need to click to expand it.
## <a id="msi" />Installing the MSI package The MSI file looks like `PowerShell-<version>-win-<os-arch>.msi`. For example: -- `PowerShell-7.1.0-win-x64.msi`-- `PowerShell-7.1.0-win-x86.msi`
+- `PowerShell-7.1.1-win-x64.msi`
+- `PowerShell-7.1.1-win-x86.msi`
Once downloaded, double-click the installer and follow the prompts.
@@ -69,7 +68,7 @@ installation options:
The following example shows how to silently install PowerShell with all the install options enabled. ```powershell
-msiexec.exe /package PowerShell-7.1.0-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1
+msiexec.exe /package PowerShell-7.1.1-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1
``` For a full list of command-line options for `Msiexec.exe`, see
@@ -98,10 +97,10 @@ values are changed for each major release.
PowerShell binary ZIP archives are provided to enable advanced deployment scenarios. Download one of the following ZIP archives from the [releases][releases] page. -- PowerShell-7.1.0-win-x64.zip-- PowerShell-7.1.0-win-x86.zip-- PowerShell-7.1.0-win-arm64.zip-- PowerShell-7.1.0-win-arm32.zip
+- PowerShell-7.1.1-win-x64.zip
+- PowerShell-7.1.1-win-x86.zip
+- PowerShell-7.1.1-win-arm64.zip
+- PowerShell-7.1.1-win-arm32.zip
Depending on how you download the file you may need to unblock the file using the `Unblock-File` cmdlet. Unzip the contents to the location of your choice and run `pwsh.exe` from there. Unlike
@@ -262,8 +261,8 @@ The following commands can be used to install PowerShell using the published `wi
```Output Name Id Version
- PowerShell Microsoft.PowerShell 7.1.0
- PowerShell-Preview Microsoft.PowerShell-Preview 7.1.0-preview.5
+ PowerShell Microsoft.PowerShell 7.1.1
+ PowerShell-Preview Microsoft.PowerShell-Preview 7.1.1-preview.5
``` 1. Install a version of PowerShell using the `--exact` parameter
@@ -340,8 +339,8 @@ support those methods.
<!-- link references -->
-[releases]: https://github.com/PowerShell/PowerShell/releases
-[latest]: https://github.com/PowerShell/PowerShell/releases/latest
+[preview]: https://aka.ms/powershell-release?tag=preview
+[latest]: https://aka.ms/powershell-release?tag=stable
[ssh-remoting]: ../learn/remoting/SSH-Remoting-in-PowerShell-Core.md [wsman-remoting]: ../learn/remoting/WSMan-Remoting-in-PowerShell-Core.md [AppVeyor]: https://ci.appveyor.com/project/PowerShell/powershell
install https://docs.microsoft.com/en-us/powershell/scripting/install/Installing-PowerShell-Core-on-macOS https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/install/Installing-PowerShell-Core-on-macOS.md
@@ -1,7 +1,7 @@
Title: Installing PowerShell on macOS description: Information about installing PowerShell on macOS Previously updated : 11/11/2020 Last updated : 02/02/2021 # Installing PowerShell on macOS
@@ -118,13 +118,13 @@ brew upgrade powershell
## Installation via Direct Download
-Download the PKG package `powershell-7.1.0-osx-x64.pkg` from the [releases][] page onto your
+Download the PKG package `powershell-7.1.1-osx-x64.pkg` from the [releases][] page onto your
macOS machine. You can double-click the file and follow the prompts, or install it from the terminal: ```sh
-sudo installer -pkg powershell-7.1.0-osx-x64.pkg -target /
+sudo installer -pkg powershell-7.1.1-osx-x64.pkg -target /
``` Install [OpenSSL](#installing-dependencies). OpenSSL is needed for PowerShell remoting and CIM
@@ -159,19 +159,19 @@ operations.
```sh # Download the powershell '.tar.gz' archive
-curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-osx-x64.tar.gz
+curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/powershell-7.1.1-osx-x64.tar.gz
# Create the target folder where powershell will be placed
-sudo mkdir -p /usr/local/microsoft/powershell/7.1.0
+sudo mkdir -p /usr/local/microsoft/powershell/7.1.1
# Expand powershell to the target folder
-sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/7.1.0
+sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/7.1.1
# Set execute permissions
-sudo chmod +x /usr/local/microsoft/powershell/7.1.0/pwsh
+sudo chmod +x /usr/local/microsoft/powershell/7.1.1/pwsh
# Create the symbolic link that points to pwsh
-sudo ln -s /usr/local/microsoft/powershell/7.1.0/pwsh /usr/local/bin/pwsh
+sudo ln -s /usr/local/microsoft/powershell/7.1.1/pwsh /usr/local/bin/pwsh
``` ## Installing dependencies
@@ -224,7 +224,7 @@ and remove the paths using `sudo rm`.
## Paths -- `$PSHOME` is `/usr/local/microsoft/powershell/7.1.0/`
+- `$PSHOME` is `/usr/local/microsoft/powershell/7.1.1/`
- User profiles will be read from `~/.config/powershell/profile.ps1` - Default profiles will be read from `$PSHOME/profile.ps1` - User modules will be read from `~/.local/share/powershell/Modules`
@@ -238,7 +238,7 @@ exists at `Microsoft.PowerShell_profile.ps1` in the same locations.
PowerShell respects the [XDG Base Directory Specification][xdg-bds] on macOS. Because macOS is a derivation of BSD, the prefix `/usr/local` is used instead of `/opt`. So,
-`$PSHOME` is `/usr/local/microsoft/powershell/7.1.0/`, and the symbolic link is placed at
+`$PSHOME` is `/usr/local/microsoft/powershell/7.1.1/`, and the symbolic link is placed at
`/usr/local/bin/pwsh`. ## Installation support
@@ -257,5 +257,5 @@ support those methods.
[Cask]: https://github.com/Homebrew/homebrew-cask [cask-versions]: https://github.com/Homebrew/homebrew-cask-versions [GitHub]: https://github.com/Homebrew
-[releases]: https://github.com/PowerShell/PowerShell/releases/latest
+[releases]: https://aka.ms/powershell-release?tag=stable
[xdg-bds]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
learn https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-pscustomobject https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/learn/deep-dives/everything-about-pscustomobject.md
@@ -81,7 +81,7 @@ I find the best way to save a hashtable to a file is to save it as JSON. You can
a `[PSCustomObject]` ```powershell
-$myObject | ConvertTo-Json -depth 1- | Set-Content -Path $Path
+$myObject | ConvertTo-Json -depth 1 | Set-Content -Path $Path
$myObject = Get-Content -Path $Path | ConvertFrom-Json ```
@@ -95,7 +95,7 @@ I cover more ways to save objects to a file in my article on
You can still add new properties to your `PSCustomObject` with `Add-Member`. ```powershell
-$myObject | Add-Member -MemberType NoteProperty -Name `ID` -Value 'KevinMarquette'
+$myObject | Add-Member -MemberType NoteProperty -Name 'ID' -Value 'KevinMarquette'
$myObject.ID ```