Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ OutputBufferingMode : Block
AutoRestart : false
SecurityDescriptorSddl : O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
MaxMemoryPerShellMB : 1024
MaxIdleTimeoutms : 2147483647
MaxIdleTimeoutMs : 2147483647
Uri : http://schemas.microsoft.com/powershell/microsoft.powershell
SDKVersion : 2
Name : microsoft.powershell
Expand Down Expand Up @@ -296,7 +296,7 @@ violation can go undetected while the session is in use.
The fourth command uses the `Invoke-Command` cmdlet to run a `Get-PSSessionConfiguration` command
for the `Microsoft.PowerShell` session configuration on the Server01 computer. The command uses the
`Format-List` cmdlet to display all properties of the session configuration in a list.The output
shows that the **MaxIdleTimeoutMS** property, which establishes the maximum permitted
shows that the **MaxIdleTimeoutMs** property, which establishes the maximum permitted
**IdleTimeout** value for sessions that use the session configuration, is `43200000` milliseconds
(12 hours).

Expand All @@ -321,7 +321,7 @@ which is measured in milliseconds. The output confirms that the command was succ
Disconnects from sessions with the specified session ID. Type one or more IDs (separated by
commas), or use the range operator (`..`) to specify a range of IDs.

To get the ID of a session, use the `Get-PSSession` cmdlet. The instance ID is stored in the **ID**
To get the ID of a session, use the `Get-PSSession` cmdlet. The instance ID is stored in the **Id**
property of the session.

```yaml
Expand Down Expand Up @@ -376,7 +376,7 @@ The instance ID is a GUID that uniquely identifies a session on a local or remot
instance ID is unique, even across multiple sessions on multiple computers.

To get the instance ID of a session, use the `Get-PSSession` cmdlet. The instance ID is stored in
the **InstanceID** property of the session.
the **InstanceId** property of the session.

```yaml
Type: System.Guid[]
Expand Down
16 changes: 8 additions & 8 deletions reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,20 @@ remote computer. When the session starts, the command prompt changes to include
The second command gets the PowerShell process and redirects the output to the `Process.txt` file.
The command is submitted to the remote computer, and the file is saved on the remote computer.

The third command uses the **Exit** keyword to end the interactive session and close the connection.
The third command uses the `exit` keyword to end the interactive session and close the connection.
The fourth command confirms that the Process.txt file is on the remote computer. A `Get-ChildItem`
("dir") command on the local computer cannot find the file.

```powershell
PS C:\> Enter-PSSession -ComputerName Server01
[Server01]: PS C:\>
[Server01]: PS C:\> Get-Process PowerShell > C:\ps-test\Process.txt
[Server01]: PS C:\> Get-Process powershell > C:\ps-test\Process.txt
[Server01]: PS C:\> exit
PS C:\>
PS C:\> dir C:\ps-test\Process.txt
Get-ChildItem : Cannot find path 'C:\ps-test\Process.txt' because it does not exist.
At line:1 char:4
+ dir <<<< c:\ps-test\Process.txt
+ dir <<<< C:\ps-test\Process.txt
```

This command shows how to work in an interactive session with a remote computer.
Expand Down Expand Up @@ -169,7 +169,7 @@ This example shows how to start and stop an interactive session. The first comma
`Enter-PSSession` cmdlet to start an interactive session with the Server01 computer.

The second command uses the `Exit-PSSession` cmdlet to end the session. You can also use the
**Exit** keyword to end the interactive session. `Exit-PSSession` and **Exit** have the same effect.
`exit` keyword to end the interactive session. `Exit-PSSession` and `exit` have the same effect.

## PARAMETERS

Expand Down Expand Up @@ -484,7 +484,7 @@ Specifies the instance ID of an existing session. `Enter-PSSession` uses the spe
the interactive session.

The instance ID is a GUID. To find the instance ID of a session, use the `Get-PSSession` cmdlet. You
can also use the **Session**, **Name**, or **ID** parameters to specify an existing session. Or, you
can also use the **Session**, **Name**, or **Id** parameters to specify an existing session. Or, you
can use the **ComputerName** parameter to start a temporary session.

```yaml
Expand All @@ -505,7 +505,7 @@ Specifies the friendly name of an existing session. `Enter-PSSession` uses the s
the interactive session.

If the name that you specify matches more than one session, the command fails. You can also use the
**Session**, **InstanceID**, or **ID** parameters to specify an existing session. Or, you can use
**Session**, **InstanceId**, or **Id** parameters to specify an existing session. Or, you can use
the **ComputerName** parameter to start a temporary session.

To establish a friendly name for a session, use the **Name** parameter of the `New-PSSession`
Expand Down Expand Up @@ -571,15 +571,15 @@ Accept wildcard characters: False
### -Session

Specifies a PowerShell session (**PSSession**) to use for the interactive session. This parameter
takes a session object. You can also use the **Name**, **InstanceID**, or **ID** parameters to
takes a session object. You can also use the **Name**, **InstanceId**, or **Id** parameters to
specify a **PSSession**.

Enter a variable that contains a session object or a command that creates or gets a session object,
such as a `New-PSSession` or `Get-PSSession` command. You can also pipe a session object to
`Enter-PSSession`. You can submit only one **PSSession** by using this parameter. If you enter a
variable that contains more than one **PSSession**, the command fails.

When you use `Exit-PSSession` or the **EXIT** keyword, the interactive session ends, but the
When you use `Exit-PSSession` or the `exit` keyword, the interactive session ends, but the
**PSSession** that you created remains open and available for use.

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The third command uses `Exit-PSSession` to stop the interactive session.
The final command displays the **PSSession** in the `$s` variable. The **State** property shows the
**PSSession** is still open and available for use.

### Example 3: Use the Exit keyword to stop a session
### Example 3: Use the `exit` keyword to stop a session

```powershell
PS C:\> Enter-PSSession -ComputerName Server01
Expand Down
18 changes: 9 additions & 9 deletions reference/5.1/Microsoft.PowerShell.Core/ForEach-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ command.
`Get-Process | ForEach-Object {$_.ProcessName}`

`ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in
[about_functions](about/about_functions.md#piping-objects-to-functions).
[about_Functions](about/about_functions.md#piping-objects-to-functions).

> [!NOTE]
> The script blocks run in the caller's scope. Therefore, the blocks have access to variables in
Expand Down Expand Up @@ -88,7 +88,7 @@ Get-ChildItem $PSHOME |

If the object isn't a directory, the script block gets the name of the file, divides the value of
its **Length** property by 1024, and adds a space (" ") to separate it from the next entry. The
cmdlet uses the **PSISContainer** property to determine whether an object is a directory.
cmdlet uses the **PSIsContainer** property to determine whether an object is a directory.

### Example 3: Operate on the most recent System events

Expand Down Expand Up @@ -163,7 +163,7 @@ the **MemberName** parameter of the `ForEach-Object` cmdlet.

```powershell
Get-Module -ListAvailable | ForEach-Object -MemberName Path
Get-Module -ListAvailable | Foreach Path
Get-Module -ListAvailable | foreach Path
```

The second command is equivalent to the first. It uses the `Foreach` alias of the `ForEach-Object`
Expand All @@ -185,7 +185,7 @@ are equivalent and interchangeable. The output is the same for all three cases.
"Microsoft.PowerShell.Core", "Microsoft.PowerShell.Host" |
ForEach-Object -MemberName Split -ArgumentList "."
"Microsoft.PowerShell.Core", "Microsoft.PowerShell.Host" |
Foreach Split "."
foreach Split "."
```

```Output
Expand All @@ -204,7 +204,7 @@ argument.
The second command uses the **MemberName** parameter to specify the **Split** method and the
**ArgumentList** parameter to identify the dot (`.`) as the split delimiter.

The third command uses the **Foreach** alias of the `ForEach-Object` cmdlet and omits the names of
The third command uses the `foreach` alias of the `ForEach-Object` cmdlet and omits the names of
the **MemberName** and **ArgumentList** parameters, which are optional.

### Example 8: Using ForEach-Object with two script blocks
Expand Down Expand Up @@ -354,7 +354,7 @@ Specifies the name of the member property to get or the member method to call. T
instance members, not static members.

Wildcard characters are permitted, but work only if the resulting string resolves to a unique value.
For example, if you run `Get-Process | ForEach -MemberName *Name`, the wildcard pattern matches more
For example, if you run `Get-Process | foreach -MemberName *Name`, the wildcard pattern matches more
than one member causing the command to fail.

This parameter was introduced in Windows PowerShell 3.0.
Expand Down Expand Up @@ -471,12 +471,12 @@ Windows PowerShell includes the following aliases for `ForEach-Object`:
- `%`
- `foreach`

The `ForEach-Object` cmdlet works much like the **Foreach** statement, except that you cannot pipe
input to a **Foreach** statement. For more information about the **Foreach** statement, see
The `ForEach-Object` cmdlet works much like the `foreach` statement, except that you cannot pipe
input to a `foreach` statement. For more information about the `foreach` statement, see
[about_Foreach](./About/about_Foreach.md).

Starting in PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections. You
can read more about these new methods here [about_arrays](./About/about_Arrays.md)
can read more about these new methods here [about_Arrays](./About/about_Arrays.md)

## RELATED LINKS

Expand Down
26 changes: 13 additions & 13 deletions reference/5.1/Microsoft.PowerShell.Core/Get-Command.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ have been imported into the current session, use the **ListImported** parameter.

Without parameters, `Get-Command` gets all the cmdlets, functions, and aliases installed on the
computer. `Get-Command *` gets all types of commands, including all the non-PowerShell files in the
Path environment variable (`$env:PATH`), which it lists in the Application command type.
PATH environment variable (`$Env:PATH`), which it lists in the Application command type.

`Get-Command` that uses the exact name of the command, without wildcard characters, automatically
imports the module that contains the command so that you can use the command immediately. To enable,
Expand Down Expand Up @@ -114,7 +114,7 @@ This command uses the **ArgumentList** and **Syntax** parameters to get the synt
the Certificate Provider adds to the session.

```powershell
Get-Command -Name Get-Childitem -Args Cert: -Syntax
Get-Command -Name Get-ChildItem -Args Cert: -Syntax
```

When you compare the syntax displayed in the output with the syntax that's displayed when you omit
Expand Down Expand Up @@ -154,7 +154,7 @@ cmdlet by another cmdlet or a provider.
### Example 8: Get all commands of all types

This command gets all commands of all types on the local computer, including executable files in the
paths of the **Path** environment variable (`$env:PATH`).
paths of the **PATH** environment variable (`$Env:PATH`).

```powershell
Get-Command *
Expand Down Expand Up @@ -262,7 +262,7 @@ code defines the **OutputType** attribute for the cmdlet.
### Example 14: Get cmdlets that take a specific object type as input

```powershell
Get-Command -ParameterType (((Get-NetAdapter)[0]).PSTypeNames)
Get-Command -ParameterType (((Get-NetAdapter)[0]).pstypenames)
```

```Output
Expand All @@ -278,11 +278,11 @@ Function Set-NetAdapter NetAdapter
This command finds cmdlets that take net adapter objects as input. You can use this command format
to find the cmdlets that accept the type of objects that any command returns.

The command uses the **PSTypeNames** intrinsic property of all objects, which gets the types that
describe the object. To get the **PSTypeNames** property of a net adapter, and not the
**PSTypeNames** property of a collection of net adapters, the command uses array notation to get the
first net adapter that the cmdlet returns. To get the **PSTypeNames** property of a net adapter, and
not the **PSTypeNames** property of a collection of net adapters, the command uses array notation to
The command uses the **pstypenames** intrinsic property of all objects, which gets the types that
describe the object. To get the **pstypenames** property of a net adapter, and not the
**pstypenames** property of a collection of net adapters, the command uses array notation to get the
first net adapter that the cmdlet returns. To get the **pstypenames** property of a net adapter, and
not the **pstypenames** property of a collection of net adapters, the command uses array notation to
get the first net adapter that the cmdlet returns.

## PARAMETERS
Expand Down Expand Up @@ -352,15 +352,15 @@ The acceptable values for this parameter are:

- `All`: Gets all command types. This parameter value is the equivalent of `Get-Command *`.

- `Application`: Searches folders in the `$env:PATH` environment variable for non-PowerShell
- `Application`: Searches folders in the `$Env:PATH` environment variable for non-PowerShell
executable files. On Windows, executable files have a file extension that is listed in the
`$env:PATHEXT` environment variable. For more information, see
`$Env:PATHEXT` environment variable. For more information, see
[about_Environment_Variables](About/about_Environment_Variables.md).

- `Cmdlet`: Gets all cmdlets.

- `ExternalScript`: Gets all `.ps1` files in the paths listed in the **Path** environment variable
(`$env:PATH`).
- `ExternalScript`: Gets all `.ps1` files in the paths listed in the **PATH** environment variable
(`$Env:PATH`).

- `Filter` and `Function`: Gets all PowerShell advanced and simple functions and filters.

Expand Down
2 changes: 1 addition & 1 deletion reference/5.1/Microsoft.PowerShell.Core/Get-Help.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ script, or workflow, such as `Get-Member`, a conceptual article name, such as `a
alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't
use wildcard characters to find the names of function help and script help articles.

To get help for a script that isn't located in a path that's listed in the `$env:Path` environment
To get help for a script that isn't located in a path that's listed in the `$Env:PATH` environment
variable, type the script's path and file name.

If you enter the exact name of a help article, `Get-Help` displays the article contents.
Expand Down
2 changes: 1 addition & 1 deletion reference/5.1/Microsoft.PowerShell.Core/Get-History.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ saves it in the History.csv file. The file includes the data that is displayed w
history as a list. This includes the status and start and end times of the command.

```powershell
Get-History -ID 7 -Count 5 | Export-Csv -Path History.csv
Get-History -Id 7 -Count 5 | Export-Csv -Path History.csv
```

### Example 4: Display the most recent command
Expand Down
14 changes: 7 additions & 7 deletions reference/5.1/Microsoft.PowerShell.Core/Get-Job.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Get-Job
```Output
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Completed True localhost $env:COMPUTERNAME
1 Job1 BackgroundJob Completed True localhost $Env:COMPUTERNAME
```

### Example 2: Stop a job by using an instance ID
Expand All @@ -113,7 +113,7 @@ instance ID of the job.

```powershell
$j = Get-Job -Name Job1
$ID = $j.InstanceID
$ID = $j.InstanceId
$ID
```

Expand Down Expand Up @@ -179,7 +179,7 @@ Get-Job -Name Job*
```Output
Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
1 Job1 BackgroundJob Completed True localhost $env:COMPUTERNAME
1 Job1 BackgroundJob Completed True localhost $Env:COMPUTERNAME
```

### Example 7: Use a job object to represent the job in a command
Expand Down Expand Up @@ -316,7 +316,7 @@ PS> Get-Job | Format-List -Property *
HasMoreData : False
StatusMessage :
Location : localhost
Command : get-process
Command : Get-Process
JobStateInfo : Failed
Finished : System.Threading.ManualReset
EventInstanceId : fb792295-1318-4f5d-8ac8-8a89c5261507
Expand All @@ -331,7 +331,7 @@ Debug : {}
Warning : {}
StateChanged :
PS> (Get-Job -Name job2).JobStateInfo.Reason
PS> (Get-Job -Name Job2).JobStateInfo.Reason
Connecting to remote server using WSManCreateShellEx api failed. The async callback gave the
following error message: Access is denied.
```
Expand All @@ -342,15 +342,15 @@ This example shows how to use the **Filter** parameter to get a workflow job. Th
parameter, introduced in Windows PowerShell 3.0 is valid only on custom job types, such as workflow
jobs and scheduled jobs.

The first command uses the **Workflow** keyword to create the WFProcess workflow. The second command
The first command uses the `workflow` keyword to create the WFProcess workflow. The second command
uses the **AsJob** parameter of the WFProcess workflow to run the workflow as a background job. It
uses the **JobName** parameter of the workflow to specify a name for the job, and the
**PSPrivateMetadata** parameter of the workflow to specify a custom ID. The third command uses the
**Filter** parameter of `Get-Job` to get the job by custom ID that was specified in the
**PSPrivateMetadata** parameter.

```powershell
PS> Workflow WFProcess {Get-Process}
PS> workflow WFProcess {Get-Process}
PS> WFProcess -AsJob -JobName WFProcessJob -PSPrivateMetadata @{MyCustomId = 92107}
PS> Get-Job -Filter @{MyCustomId = 92107}
Id Name State HasMoreData Location Command
Expand Down
Loading