diff --git a/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md index f6af4b6f8020..0f0a95a7acd1 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md b/reference/5.1/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md index e2c7bcda5bbc..62613c9e66c2 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md @@ -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 @@ -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 @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Remove-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Remove-Job.md index f38362550bcb..3016c4c34018 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Remove-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Remove-Job.md @@ -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. @@ -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 @@ -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 ``` @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md index bb83c4aa0c91..45f72bd6b0e1 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md @@ -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 @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSession.md index 78ff45152db6..c4d1af936e3d 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Remove-PSSession.md @@ -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 @@ -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 @@ -134,18 +134,18 @@ 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. @@ -153,7 +153,7 @@ 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 @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index 24494ddc6ff7..fafa927a5291 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -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 ``` @@ -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" @@ -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 ``` @@ -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 @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Start-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Start-Job.md index ff59780f1f53..e53f8e9c77ae 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Start-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Start-Job.md @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/Stop-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Stop-Job.md index 380f4e245e0e..2847fae8c41f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Stop-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Stop-Job.md @@ -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 @@ -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. @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/TabExpansion2.md b/reference/5.1/Microsoft.PowerShell.Core/TabExpansion2.md index 191548478e05..a85a32bbd475 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/TabExpansion2.md +++ b/reference/5.1/Microsoft.PowerShell.Core/TabExpansion2.md @@ -86,7 +86,7 @@ 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 @@ -94,7 +94,7 @@ function GetData { 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' diff --git a/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 9d3d4dd22783..27dd27f84437 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md index 7404fdcd5520..c632d93344fe 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md b/reference/7.4/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md index 6287c7330f96..c8e67026e3e1 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md @@ -95,14 +95,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 @@ -507,8 +507,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 @@ -732,7 +732,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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Remove-Job.md b/reference/7.4/Microsoft.PowerShell.Core/Remove-Job.md index 8783ee49edd4..281b63c0f014 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Remove-Job.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Remove-Job.md @@ -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. @@ -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 @@ -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 ``` @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Remove-Module.md b/reference/7.4/Microsoft.PowerShell.Core/Remove-Module.md index b9b084ae79f1..94dc45eb3d44 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Remove-Module.md @@ -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 @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Remove-PSSession.md b/reference/7.4/Microsoft.PowerShell.Core/Remove-PSSession.md index db60ae6cc4b1..951a75b9da40 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Remove-PSSession.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Remove-PSSession.md @@ -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 @@ -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 @@ -134,18 +134,18 @@ 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. @@ -153,7 +153,7 @@ 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 @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index 8a7df73a0b26..ec7a4833d76a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -118,7 +118,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 ``` @@ -133,7 +133,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" @@ -144,11 +144,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 ``` @@ -165,7 +165,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 @@ -181,7 +181,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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/Start-Job.md b/reference/7.4/Microsoft.PowerShell.Core/Start-Job.md index bb69f3a5ab1f..165e0322a2b5 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Start-Job.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Start-Job.md @@ -208,11 +208,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 7: Collect and save data by using a background job diff --git a/reference/7.4/Microsoft.PowerShell.Core/Stop-Job.md b/reference/7.4/Microsoft.PowerShell.Core/Stop-Job.md index 950688600c82..2adef41441cd 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Stop-Job.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Stop-Job.md @@ -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 @@ -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. @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/TabExpansion2.md b/reference/7.4/Microsoft.PowerShell.Core/TabExpansion2.md index 4fc9da7401b9..99204be6b157 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/TabExpansion2.md +++ b/reference/7.4/Microsoft.PowerShell.Core/TabExpansion2.md @@ -76,7 +76,7 @@ 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 @@ -84,7 +84,7 @@ function GetData { 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' diff --git a/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 48094f7c1fa7..f20686a5fccb 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md index 459df57b3986..2cc0a3119486 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -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 @@ -320,7 +320,7 @@ This example shows what happens to a job that's running in a disconnected sessio ```powershell 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 @@ -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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md b/reference/7.5/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md index 70c59b58d756..5c26bd3a003f 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md @@ -91,7 +91,7 @@ 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' } @@ -509,8 +509,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 @@ -736,7 +736,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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Remove-Job.md b/reference/7.5/Microsoft.PowerShell.Core/Remove-Job.md index b3af797be641..45b35c5eb476 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Remove-Job.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Remove-Job.md @@ -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. @@ -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 ``` @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Remove-Module.md b/reference/7.5/Microsoft.PowerShell.Core/Remove-Module.md index 508e292dff13..83f1a85f56a2 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Remove-Module.md @@ -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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Remove-PSSession.md b/reference/7.5/Microsoft.PowerShell.Core/Remove-PSSession.md index 477b12c9ab1e..6deab4f92b3b 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Remove-PSSession.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Remove-PSSession.md @@ -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 @@ -110,17 +110,17 @@ with `Serv`. ### Example 4: Close sessions connected to a port ```powershell -Get-PSSession | Where-Object {$_.port -eq 90} | Remove-PSSession +Get-PSSession | Where-Object {$_.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**. +**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 @@ -134,18 +134,18 @@ 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. @@ -153,7 +153,7 @@ 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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index 9ab34198c758..085960957e2a 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -118,7 +118,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 ``` @@ -133,7 +133,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" @@ -144,11 +144,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 ``` @@ -165,7 +165,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 @@ -181,7 +181,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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/Start-Job.md b/reference/7.5/Microsoft.PowerShell.Core/Start-Job.md index 6ef36e59c512..7922fc7c7dd4 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Start-Job.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Start-Job.md @@ -209,11 +209,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 7: Collect and save data by using a background job diff --git a/reference/7.5/Microsoft.PowerShell.Core/Stop-Job.md b/reference/7.5/Microsoft.PowerShell.Core/Stop-Job.md index 1f755d954106..8542e77aaf71 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Stop-Job.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Stop-Job.md @@ -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 @@ -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. @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/TabExpansion2.md b/reference/7.5/Microsoft.PowerShell.Core/TabExpansion2.md index 8cc26cd50126..a46d3b297ab9 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/TabExpansion2.md +++ b/reference/7.5/Microsoft.PowerShell.Core/TabExpansion2.md @@ -76,7 +76,7 @@ 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 @@ -84,7 +84,7 @@ function GetData { 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' diff --git a/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md index ae8545d72571..06ca7edf48c5 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -51,7 +51,7 @@ This command tests the `TestModule.psd1` module manifest. 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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md index d2aeb6bb518d..bdf5eee2777c 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md b/reference/7.6/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md index eb8b1ead28a0..b6a886029751 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Register-PSSessionConfiguration.md @@ -91,7 +91,7 @@ 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' } @@ -509,8 +509,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 @@ -734,7 +734,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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Remove-Job.md b/reference/7.6/Microsoft.PowerShell.Core/Remove-Job.md index 4751832410af..f0e97a1c93c6 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Remove-Job.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Remove-Job.md @@ -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. @@ -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 @@ -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 ``` @@ -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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Remove-Module.md b/reference/7.6/Microsoft.PowerShell.Core/Remove-Module.md index 5285c3118114..4ac761b33e51 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Remove-Module.md @@ -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 @@ -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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Remove-PSSession.md b/reference/7.6/Microsoft.PowerShell.Core/Remove-PSSession.md index f49f1cb2e59b..70d318ed99a0 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Remove-PSSession.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Remove-PSSession.md @@ -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 @@ -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 @@ -134,18 +134,18 @@ 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. @@ -153,7 +153,7 @@ 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 @@ -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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md b/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md index 2b42597f8682..d95fbe68fdf9 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Set-PSSessionConfiguration.md @@ -118,7 +118,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 ``` @@ -133,7 +133,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" @@ -144,11 +144,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 ``` @@ -165,7 +165,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 @@ -181,7 +181,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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/Start-Job.md b/reference/7.6/Microsoft.PowerShell.Core/Start-Job.md index 8a72a6481ee0..8761d0306687 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Start-Job.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Start-Job.md @@ -208,11 +208,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 7: Collect and save data by using a background job diff --git a/reference/7.6/Microsoft.PowerShell.Core/Stop-Job.md b/reference/7.6/Microsoft.PowerShell.Core/Stop-Job.md index 412d5c948a22..fcfba50276e7 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Stop-Job.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Stop-Job.md @@ -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 @@ -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. @@ -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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/TabExpansion2.md b/reference/7.6/Microsoft.PowerShell.Core/TabExpansion2.md index 3dfa07743d80..777a185f8394 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/TabExpansion2.md +++ b/reference/7.6/Microsoft.PowerShell.Core/TabExpansion2.md @@ -76,7 +76,7 @@ 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 @@ -84,7 +84,7 @@ function GetData { 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' diff --git a/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md b/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md index 232e20d70f39..e41edf54d140 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Test-ModuleManifest.md @@ -51,7 +51,7 @@ This command tests the `TestModule.psd1` module manifest. 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