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 @@ -256,7 +256,7 @@ PS> $parms = @{
ConfigurationName = "ITTasks"
}
PS> Invoke-Command @parms
PS> Exit
PS> exit
PS> $s = Get-PSSession -ComputerName Server01, Server02, Server30 -Name BugStatus
Expand Down Expand Up @@ -318,7 +318,7 @@ This example shows what happens to a job that's running in a disconnected sessio

```
PS> $s = New-PSSession -ComputerName Server01 -Name Test
PS> $j = Invoke-Command -Session $s { 1..1500 | Foreach-Object {"Return $_"; sleep 30}} -AsJob
PS> $j = Invoke-Command -Session $s { 1..1500 | ForEach-Object {"Return $_"; sleep 30}} -AsJob
PS> $j
Id Name State HasMoreData Location
Expand Down Expand Up @@ -501,7 +501,7 @@ computer.

Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of one computer.
Wildcard characters aren't permitted. To specify the local computer, type the computer name, a dot
(`.`), `$env:COMPUTERNAME`, or localhost.
(`.`), `$Env:COMPUTERNAME`, or localhost.

```yaml
Type: System.String
Expand Down Expand Up @@ -633,7 +633,7 @@ Accept wildcard characters: False

Specifies the instance ID of the disconnected session. The instance ID is a GUID that uniquely
identifies a **PSSession** on a local or remote computer. The instance ID is stored in the
**InstanceID** property of the **PSSession**.
**InstanceId** property of the **PSSession**.

```yaml
Type: System.Guid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ parameter specifies the configuration class to use from the assembly.
```powershell
$sessionConfiguration = @{
Name='NewShell'
ApplicationBase='c:\MyShells\'
ApplicationBase='C:\MyShells\'
AssemblyName='MyShell.dll'
ConfigurationTypeName='MyClass'
}
Register-PSSessionConfiguration @sessionConfiguration
```

To use this configuration, type `New-PSSession -ConfigurationName newshell`.
To use this configuration, type `New-PSSession -ConfigurationName NewShell`.

### Example 2: Register a MaintenanceShell session configuration

Expand Down Expand Up @@ -504,8 +504,8 @@ instead of this parameter. You can't use both parameters in the same command.

If you omit this parameter, the root SDDL for the **WinRM** service is used for this configuration.
To view or change the root SDDL, use the WSMan provider. For example
`Get-Item wsman:\localhost\service\rootSDDL`. For more information about the WSMan provider, type
`Get-Help wsman`.
`Get-Item WSMan:\localhost\service\rootSDDL`. For more information about the WSMan provider, type
`Get-Help WSMan`.

```yaml
Type: System.String
Expand Down Expand Up @@ -761,7 +761,7 @@ To run this cmdlet you must start PowerShell by using the **Run as administrator

This cmdlet generates XML that represents a Web Services for Management (WS-Management) plug-in
configuration and sends the XML to WS-Management, which registers the plug-in on the local computer
(`New-Item wsman:\localhost\plugin`).
(`New-Item WSMan:\localhost\plugin`).

The properties of a session configuration object vary with the options set for the session
configuration and the values of those options. Also, session configurations that use a session
Expand Down
8 changes: 4 additions & 4 deletions reference/5.1/Microsoft.PowerShell.Core/Remove-Job.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The `Remove-Job` cmdlet deletes PowerShell background jobs that were started by
cmdlet or by cmdlets such as `Invoke-Command` that support the **AsJob** parameter.

You can use `Remove-Job` to delete all jobs or delete selected jobs. The jobs are identified by
their **Name**, **ID**, **Instance ID**, **Command**, or **State**. Or, a job object can be sent
their **Name**, **Id**, **InstanceId**, **Command**, or **State**. Or, a job object can be sent
down the pipeline to `Remove-Job`. Without parameters or parameter values, `Remove-Job` has no
effect.

Expand Down Expand Up @@ -98,7 +98,7 @@ An alternative is to use the **Job** parameter, such as `Remove-Job -Job $batch`
In this example, all the jobs in the current PowerShell session are deleted.

```powershell
Get-job | Remove-Job
Get-Job | Remove-Job
```

`Get-Job` gets all the jobs in the current PowerShell session. The job objects are sent down the
Expand Down Expand Up @@ -172,7 +172,7 @@ the job named **MyJob** is deleted.
This example removes a job based on its **InstanceId**.

```powershell
$job = Start-Job -ScriptBlock {Get-Process PowerShell}
$job = Start-Job -ScriptBlock {Get-Process powershell}
$job | Format-List -Property *
Remove-Job -InstanceId ad02b942-8007-4407-87f3-d23e71955872
```
Expand All @@ -182,7 +182,7 @@ State : Completed
HasMoreData : True
StatusMessage :
Location : localhost
Command : Get-Process PowerShell
Command : Get-Process powershell
JobStateInfo : Completed
Finished : System.Threading.ManualResetEvent
InstanceId : ad02b942-8007-4407-87f3-d23e71955872
Expand Down
4 changes: 2 additions & 2 deletions reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ $OnRemoveScript = {
$ExecutionContext.SessionState.Module.OnRemove += $OnRemoveScript
$registerEngineEventSplat = @{
SourceIdentifier = ([System.Management.Automation.PsEngineEvent]::Exiting)
SourceIdentifier = ([System.Management.Automation.PSEngineEvent]::Exiting)
Action = $OnRemoveScript
}
Register-EngineEvent @registerEngineEventSplat
Expand All @@ -128,7 +128,7 @@ The `$OnRemoveScript` variable contains the script block that cleans up the reso
the script block by assigning it to `$ExecutionContext.SessionState.Module.OnRemove`. You can also
use `Register-EngineEvent` to have the script block execute when the PowerShell session ends.

For script-based modules, you would add this code to the `.PSM1` file or put it in a startup script
For script-based modules, you would add this code to the `.psm1` file or put it in a startup script
that is listed in the **ScriptsToProcess** property of the module manifest.

## PARAMETERS
Expand Down
22 changes: 11 additions & 11 deletions reference/5.1/Microsoft.PowerShell.Core/Remove-PSSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ stops any commands that are running in the **PSSessions**, ends the **PSSession*
resources that the **PSSession** was using. If the **PSSession** is connected to a remote computer,
this cmdlet also closes the connection between the local and remote computers.

To remove a **PSSession**, enter the **Name**, **ComputerName**, **ID**, or **InstanceID** of the
To remove a **PSSession**, enter the **Name**, **ComputerName**, **Id**, or **InstanceId** of the
session.

If you have saved the **PSSession** in a variable, the session object remains in the variable, but
Expand Down Expand Up @@ -110,17 +110,17 @@ with `Serv`.
### Example 4: Close sessions connected to a port

```powershell
Get-PSSession | where {$_.port -eq 90} | Remove-PSSession
Get-PSSession | where {$_.Port -eq 90} | Remove-PSSession
```

This command closes the **PSSessions** that are connected to port 90. You can use this command
format to identify **PSSessions** by properties other than **ComputerName**, **Name**, **InstanceID**, and
**ID**.
format to identify **PSSessions** by properties other than **ComputerName**, **Name**, **InstanceId**, and
**Id**.

### Example 5: Close a session by instance ID

```powershell
Get-PSSession | Format-Table ComputerName, InstanceID -AutoSize
Get-PSSession | Format-Table ComputerName, InstanceId -AutoSize
```

```Output
Expand All @@ -134,26 +134,26 @@ TX-TEST-01 fc4e9dfa-f246-452d-9fa3-1adbdd64ae85
```

```powershell
Remove-PSSession -InstanceID fc4e9dfa-f246-452d-9fa3-1adbdd64ae85
Remove-PSSession -InstanceId fc4e9dfa-f246-452d-9fa3-1adbdd64ae85
```

These commands show how to close a **PSSession** based on its instance ID, or **RemoteRunspaceID**.

The first command uses the `Get-PSSession` cmdlet to get the **PSSessions** in the current session.
It uses a pipeline operator (`|`) to send the **PSSessions** to the `Format-Table` cmdlet, which
formats their **ComputerName** and **InstanceID** properties in a table. The **AutoSize** parameter
formats their **ComputerName** and **InstanceId** properties in a table. The **AutoSize** parameter
compresses the columns for display.

From the resulting display, you can identify the **PSSession** to be closed, and copy and paste the
**InstanceID** of that **PSSession** into the second command.
**InstanceId** of that **PSSession** into the second command.

The second command uses the `Remove-PSSession` cmdlet to remove the **PSSession** with the specified
instance ID.

### Example 6: Create a function that deletes all sessions in the current session

```powershell
Function EndPSS { Get-PSSession | Remove-PSSession }
function EndPSS { Get-PSSession | Remove-PSSession }
```

This function closes every **PSSession** in the current session. After you add this function to your
Expand Down Expand Up @@ -229,8 +229,8 @@ instance IDs.
The instance ID is a GUID that uniquely identifies a **PSSession** in the current session. The
instance ID is unique, even when you have multiple sessions running on a single computer.

The instance ID is stored in the **InstanceID** property of the object that represents a
**PSSession**. To find the **InstanceID** of the **PSSessions** in the current session, type
The instance ID is stored in the **InstanceId** property of the object that represents a
**PSSession**. To find the **InstanceId** of the **PSSessions** in the current session, type
`Get-PSSession | Format-Table Name, ComputerName, InstanceId`.

```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ParamName ParamValue
psmaximumreceivedobjectsizemb 20
"Restart WinRM service"
WinRM service need to be restarted to make the changes effective. Do you want to run the command "restart-service winrm"?
WinRM service need to be restarted to make the changes effective. Do you want to run the command "Restart-Service winrm"?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
```

Expand All @@ -140,7 +140,7 @@ operator (`|`) sends the results of the command to `Format-List`, which displays
of the configuration object in a list. Next, using the WSMan provider, we view the initialization
parameters for the **MaintenanceShell** configuration. `Get-ChildItem` gets the child items in the
**InitializationParameters** node for the **MaintenanceShell** plug-in. For more information about
the WSMan provider, type `Get-Help wsman`.
the WSMan provider, type `Get-Help WSMan`.

```powershell
Set-PSSessionConfiguration -Name "MaintenanceShell" -StartupScript "C:\ps-test\Maintenance.ps1"
Expand All @@ -151,11 +151,11 @@ WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin\MaintenanceShell
ParamName ParamValue
--------- ----------
startupscript c:\ps-test\Mainte...
startupscript C:\ps-test\Mainte...
"Restart WinRM service"
WinRM service need to be restarted to make the changes effective. Do you want to run
the command "restart-service winrm"?
the command "Restart-Service winrm"?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
```
Expand All @@ -172,7 +172,7 @@ SDKVersion : 1
XmlRenderingType : text
lang : en-US
PSVersion : 2.0
startupscript : c:\ps-test\Maintenance.ps1
startupscript : C:\ps-test\Maintenance.ps1
ResourceUri : http://schemas.microsoft.com/powershell/MaintenanceShell
SupportsOptions : true
ExactMatch : true
Expand All @@ -188,7 +188,7 @@ Get-ChildItem WSMan:\localhost\Plugin\MaintenanceShell\InitializationParameters
ParamName ParamValue
--------- ----------
PSVersion 2.0
startupscript c:\ps-test\Maintenance.ps1
startupscript C:\ps-test\Maintenance.ps1
```

## PARAMETERS
Expand Down
4 changes: 2 additions & 2 deletions reference/5.1/Microsoft.PowerShell.Core/Start-Job.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ computer.
This example uses a background job to get a specified process by name.

```powershell
Start-Job -Name PShellJob -ScriptBlock { Get-Process -Name PowerShell }
Start-Job -Name PShellJob -ScriptBlock { Get-Process -Name powershell }
```

`Start-Job` uses the **Name** parameter to specify a friendly job name, **PShellJob**. The
**ScriptBlock** parameter specifies `Get-Process` to get processes with the name **PowerShell**.
**ScriptBlock** parameter specifies `Get-Process` to get processes with the name `powershell`.

### Example 6: Collect and save data by using a background job

Expand Down
20 changes: 10 additions & 10 deletions reference/5.1/Microsoft.PowerShell.Core/Stop-Job.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ feature.
```powershell
$s = New-PSSession -ComputerName Server01 -Credential Domain01\Admin02
$j = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog -LogName System}}
Invoke-Command -Session $s -ScriptBlock { Stop-job -Job $Using:j }
Invoke-Command -Session $s -ScriptBlock { Stop-Job -Job $Using:j }
```

This example shows how to use the `Stop-Job` cmdlet to stop a job that is running on a remote
Expand All @@ -98,8 +98,8 @@ stored in the `$j` variable.

The third command stops the job. It uses the `Invoke-Command` cmdlet to run a `Stop-Job` command in
the **PSSession** on Server01. Because the job objects are stored in `$j`, which is a variable on
the local computer, the command uses the **Using** scope modifier to identify `$j` as a local
variable. For more information about the **Using** scope modifier, see
the local computer, the command uses the `Using:` scope modifier to identify `$j` as a local
variable. For more information about the `Using:` scope modifier, see
[about_Remote_Variables](about/about_Remote_Variables.md).

When the command finishes, the job is stopped and the **PSSession** in `$s` is available for use.
Expand Down Expand Up @@ -140,29 +140,29 @@ This command stops all the jobs that are blocked.

```powershell
Get-Job | Format-Table ID, Name, Command, @{Label="State";Expression={$_.JobStateInfo.State}},
InstanceID -Auto
InstanceId -Auto
```

```Output
Id Name Command State InstanceId
-- ---- ------- ----- ----------
1 Job1 start-service schedule Running 05abb67a-2932-4bd5-b331-c0254b8d9146
3 Job3 start-service schedule Running c03cbd45-19f3-4558-ba94-ebe41b68ad03
5 Job5 get-service s* Blocked e3bbfed1-9c53-401a-a2c3-a8db34336adf
1 Job1 Start-Service schedule Running 05abb67a-2932-4bd5-b331-c0254b8d9146
3 Job3 Start-Service schedule Running c03cbd45-19f3-4558-ba94-ebe41b68ad03
5 Job5 Get-Service s* Blocked e3bbfed1-9c53-401a-a2c3-a8db34336adf
```

```powershell
Stop-Job -InstanceId e3bbfed1-9c53-401a-a2c3-a8db34336adf
```

These commands show how to stop a job based on its **InstanceID**.
These commands show how to stop a job based on its **InstanceId**.

The first command uses the `Get-Job` cmdlet to get the jobs in the current session. The command uses
a pipeline operator (`|`) to send the jobs to a `Format-Table` command, which displays a table of
the specified properties of each job. The table includes the **InstanceID** of each job. It uses a
the specified properties of each job. The table includes the **InstanceId** of each job. It uses a
calculated property to display the job state.

The second command uses a `Stop-Job` command that has the **InstanceID** parameter to stop a
The second command uses a `Stop-Job` command that has the **InstanceId** parameter to stop a
selected job.

### Example 7: Stop a job on a remote computer
Expand Down
4 changes: 2 additions & 2 deletions reference/5.1/Microsoft.PowerShell.Core/TabExpansion2.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ This example shows how to get tab completion for parameter values. In this examp
this technique to test that tab completion for your function returns the expected results.

```powershell
function GetData {
function Get-Data {
param (
[ValidateSet('One', 'Two', 'Three')]
[string]$Stage
)
Write-Verbose "Retrieving data for stage $Stage"
}
$result = TabExpansion2 -inputScript ($line = 'GetData -Stage ') -cursorColumn $line.Length |
$result = TabExpansion2 -inputScript ($line = 'Get-Data -Stage ') -cursorColumn $line.Length |
Select-Object -ExpandProperty CompletionMatches
$result.Count -eq 3
$result.CompletionText -contains 'Three'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ This command tests the `TestModule.psd1` module manifest.
### Example 2: Test a manifest by using the pipeline

```powershell
"$PSHOME\Modules\TestModule.psd1" | test-modulemanifest
"$PSHOME\Modules\TestModule.psd1" | Test-ModuleManifest
```

```Output
Test-ModuleManifest : The specified type data file 'C:\Windows\System32\Wi
ndowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml' could not be processed because the file was not found. Please correct the path and try again.
At line:1 char:34
+ "$PSHOME\Modules\TestModule.psd1" | test-modulemanifest <<<<
+ "$PSHOME\Modules\TestModule.psd1" | Test-ModuleManifest <<<<
+ CategoryInfo : ResourceUnavailable: (C:\Windows\System32\WindowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml:String) [Test-ModuleManifest], FileNotFoundException
+ FullyQualifiedErrorId : Modules_TypeDataFileNotFound,Microsoft.PowerShell.Commands.TestModuleManifestCommandName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ PS> $parms = @{
ConfigurationName = "ITTasks"
}
PS> Invoke-Command @parms
PS> Exit
PS> exit
PS> $s = Get-PSSession -ComputerName Server01, Server02, Server30 -Name BugStatus
Expand Down Expand Up @@ -320,7 +320,7 @@ This example shows what happens to a job that's running in a disconnected sessio

```
PS> $s = New-PSSession -ComputerName Server01 -Name Test
PS> $j = Invoke-Command -Session $s { 1..1500 | Foreach-Object {"Return $_"; sleep 30}} -AsJob
PS> $j = Invoke-Command -Session $s { 1..1500 | ForEach-Object {"Return $_"; sleep 30}} -AsJob
PS> $j
Id Name State HasMoreData Location
Expand Down Expand Up @@ -503,7 +503,7 @@ computer.

Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of one computer.
Wildcard characters aren't permitted. To specify the local computer, type the computer name, a dot
(`.`), `$env:COMPUTERNAME`, or localhost.
(`.`), `$Env:COMPUTERNAME`, or localhost.

```yaml
Type: System.String
Expand Down Expand Up @@ -635,7 +635,7 @@ Accept wildcard characters: False

Specifies the instance ID of the disconnected session. The instance ID is a GUID that uniquely
identifies a **PSSession** on a local or remote computer. The instance ID is stored in the
**InstanceID** property of the **PSSession**.
**InstanceId** property of the **PSSession**.

```yaml
Type: System.Guid
Expand Down
Loading