diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md index 706f5f9ec977..5b871abd495e 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md @@ -160,7 +160,7 @@ two cases for that meet this criteria. ```powershell (Measure-Command { - 1..1000 | ForEach { Start-ThreadJob { Write-Output "Hello $using:_" } } | Receive-Job -Wait + 1..1000 | foreach { Start-ThreadJob { Write-Output "Hello $Using:_" } } | Receive-Job -Wait }).TotalMilliseconds 36860.8226 @@ -170,13 +170,13 @@ two cases for that meet this criteria. 7.1975 ``` -The first example above shows a foreach loop that creates 1000 thread jobs to +The first example above shows a `foreach` loop that creates 1000 thread jobs to do a simple string write. Due to job overhead, it takes over 36 seconds to complete. -The second example runs the `ForEach` cmdlet to do the same 1000 operations. -This time, `ForEach-Object` runs sequentially, on a single thread, without any -job overhead. It completes in a mere 7 milliseconds. +The second example runs the `ForEach-Object` cmdlet to do the same 1000 +operations. This time, `ForEach-Object` runs sequentially, on a single thread, +without any job overhead. It completes in a mere 7 milliseconds. In the following example, up to 5000 entries are collected for 10 separate system logs. Since the script involves reading a number of logs, it makes sense @@ -201,9 +201,9 @@ The script completes in half the time when the jobs are run in parallel. ```powershell Measure-Command { - $logs = $logNames | ForEach { + $logs = $logNames | foreach { Start-ThreadJob { - Get-WinEvent -LogName $using:_ -MaxEvents 5000 2>$null + Get-WinEvent -LogName $Using:_ -MaxEvents 5000 2>$null } -ThrottleLimit 10 } | Wait-Job | Receive-Job } @@ -218,7 +218,7 @@ $logs.Count There are multiple ways to pass values into the thread-based jobs. `Start-ThreadJob` can accept variables that are piped to the cmdlet, passed in -to the script block via the `$using` keyword, or passed in via the +to the script block via the `Using:` scope modifier, or passed in via the **ArgumentList** parameter. ```powershell @@ -226,21 +226,21 @@ $msg = "Hello" $msg | Start-ThreadJob { $input | Write-Output } | Wait-Job | Receive-Job -Start-ThreadJob { Write-Output $using:msg } | Wait-Job | Receive-Job +Start-ThreadJob { Write-Output $Using:msg } | Wait-Job | Receive-Job -Start-ThreadJob { param ([string] $message) Write-Output $message } -ArgumentList @($msg) | +Start-ThreadJob { param ([string] $Message) Write-Output $Message } -ArgumentList @($msg) | Wait-Job | Receive-Job ``` `ForEach-Object -Parallel` accepts piped in variables, and variables passed -directly to the script block via the `$using` keyword. +directly to the script block via the `Using:` scope modifier. ```powershell $msg = "Hello" $msg | ForEach-Object -Parallel { Write-Output $_ } -AsJob | Wait-Job | Receive-Job -1..1 | ForEach-Object -Parallel { Write-Output $using:msg } -AsJob | Wait-Job | Receive-Job +1..1 | ForEach-Object -Parallel { Write-Output $Using:msg } -AsJob | Wait-Job | Receive-Job ``` Since thread jobs run in the same process, any variable reference type passed @@ -255,10 +255,10 @@ the process. ```powershell $threadSafeDictionary = [System.Collections.Concurrent.ConcurrentDictionary[string,object]]::new() -$jobs = Get-Process | ForEach { +$jobs = Get-Process | foreach { Start-ThreadJob { - $proc = $using:_ - $dict = $using:threadSafeDictionary + $proc = $Using:_ + $dict = $Using:threadSafeDictionary $dict.TryAdd($proc.ProcessName, $proc) } } diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md index a29f18177081..8babf90663c8 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md @@ -33,7 +33,7 @@ remoting and reflected into current PowerShell session. This is the same transport method used for PowerShell jobs. When a module is imported into the `WinPSCompatSession` session, implicit -remoting generates a proxy module in the user's `$env:Temp` directory and +remoting generates a proxy module in the user's `$Env:TEMP` directory and imports this proxy module into current PowerShell session. The proxy module allows PowerShell to detect that the module was loaded using Windows PowerShell Compatibility functionality. @@ -97,7 +97,7 @@ $ConfigJSON = ConvertTo-Json -InputObject @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned" } $ConfigJSON | Out-File -Force $ConfigPath -pwsh -settingsFile $ConfigPath +pwsh -SettingsFile $ConfigPath ``` For more the latest information about module compatibility, see the @@ -148,7 +148,7 @@ The Windows PowerShell Compatibility functionality: The Windows PowerShell Compatibility feature uses implicit remoting to make Windows PowerShell 5.1 modules available in PowerShell 7. Implicit remoting -creates temporary files in the `$env:Temp` directory. Each proxied module is +creates temporary files in the `$Env:TEMP` directory. Each proxied module is stored in a separate folder with the following naming convention: - `remoteIpMoProxy___localhost_`. @@ -163,6 +163,6 @@ from the session or close the session. [01]: about_Modules.md -[02]: about_Powershell_Config.md +[02]: about_PowerShell_Config.md [03]: https://aka.ms/PSModuleCompat [04]: xref:Microsoft.PowerShell.Core.Import-Module diff --git a/reference/7.4/Microsoft.PowerShell.Core/Disable-PSRemoting.md b/reference/7.4/Microsoft.PowerShell.Core/Disable-PSRemoting.md index 35dc718d4495..11bc6555cc04 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Disable-PSRemoting.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Disable-PSRemoting.md @@ -248,7 +248,7 @@ disabled. ```powershell Disable-PSRemoting -Force -powershell.exe -command 'Get-PSSessionConfiguration' +powershell.exe -Command 'Get-PSSessionConfiguration' ``` ```Output @@ -300,8 +300,8 @@ Permission : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE Acce ``` ```powershell -powershell.exe -command 'Disable-PSRemoting -Force' -powershell.exe -command 'Get-PSSessionConfiguration' +powershell.exe -Command 'Disable-PSRemoting -Force' +powershell.exe -Command 'Get-PSSessionConfiguration' ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Core/Get-PSSubsystem.md b/reference/7.4/Microsoft.PowerShell.Core/Get-PSSubsystem.md index cd014140c058..d4652cf6b879 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Get-PSSubsystem.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Get-PSSubsystem.md @@ -139,7 +139,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS -[about_experimental_features](about/about_experimental_features.md) +[about_Experimental_Features](about/about_experimental_features.md) [Disable-ExperimentalFeature](Disable-ExperimentalFeature.md) diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md index d5a117897bea..fa42348e236c 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -57,14 +57,14 @@ Set-Clipboard -Value "This is a test string" -AsOSC52 ### Example 4: Set the default value of the **AsOSC52** parameter You can detect if you are connected to a remote session over SSH by checking the value of the -`$env:SSH_CLIENT` or `$env:SSH_TTY` environment variables. If either of these variables are set, +`$Env:SSH_CLIENT` or `$Env:SSH_TTY` environment variables. If either of these variables are set, then you are connected to a remote session over SSH. You can use this information to set the default value of the **AsOSC52** parameter. Add one of the following lines to your PowerShell profile script. ```powershell -$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $env:SSH_CLIENT -$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $env:SSH_TTY +$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $Env:SSH_CLIENT +$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $Env:SSH_TTY ``` For more information about `$PSDefaultParameterValues`, see diff --git a/reference/7.4/Microsoft.PowerShell.Management/Set-Location.md b/reference/7.4/Microsoft.PowerShell.Management/Set-Location.md index c1c1358df348..87785a1fdedb 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Set-Location.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Set-Location.md @@ -109,7 +109,7 @@ specified in the command. For information about location stacks, see the [Notes] ### Example 5: Navigate location history using `+` or `-` ``` -PS C:\> Set-Location -Path $env:SystemRoot +PS C:\> Set-Location -Path $Env:SystemRoot PS C:\Windows> Set-Location -Path Cert:\ PS Cert:\> Set-Location -Path HKLM:\ PS HKLM:\> diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index ba0ea837cdc4..596378f5dc2d 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -97,9 +97,9 @@ This command disables all breakpoints in the current console. ### Example 5: Disable a breakpoint in a runspace -In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakPoint` is -run. The runspace is stored in a variable and passed to the `Get-PSBreakPoint` command with the -**Runspace** parameter. The output of `Get-PSBreakPoint` is piped to `Disable-PSBreakpoint` to +In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakpoint` is +run. The runspace is stored in a variable and passed to the `Get-PSBreakpoint` command with the +**Runspace** parameter. The output of `Get-PSBreakpoint` is piped to `Disable-PSBreakpoint` to disable the breakpoint in the runspace. ```powershell @@ -110,7 +110,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Disable-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Disable-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md b/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md index 913c75ef2697..5dd2e045137f 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md @@ -118,8 +118,8 @@ This example is equivalent to running `Enable-PSBreakpoint -Id 3, 5`. ### Example 5: Enable a breakpoint in a runspace In this example, a job is started with a breakpoint is set to break then disabled. The runspace is -stored in a variable and passed to the `Get-PSBreakPoint` command with the **Runspace** parameter. -The output of `Get-PSBreakPoint` is piped to `Enable-PSBreakpoint` to enable the breakpoint in the +stored in a variable and passed to the `Get-PSBreakpoint` command with the **Runspace** parameter. +The output of `Get-PSBreakpoint` is piped to `Enable-PSBreakpoint` to enable the breakpoint in the runspace. ```powershell @@ -131,7 +131,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Enable-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Enable-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md index 629c59182fc5..5525f71b34d7 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md @@ -47,7 +47,7 @@ In this example, `Get-Error` displays the details of the most recent error that current session. ```powershell -Get-Childitem -path /NoRealDirectory +Get-ChildItem -Path /NoRealDirectory Get-Error ``` @@ -86,11 +86,11 @@ InvocationInfo : ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 57 - Line : Get-Childitem -path c:\NoRealDirectory + Line : Get-ChildItem -Path C:\NoRealDirectory PositionMessage : At line:1 char:1 - + Get-Childitem -path c:\NoRealDirectory + + Get-ChildItem -Path C:\NoRealDirectory + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - InvocationName : Get-Childitem + InvocationName : Get-ChildItem CommandOrigin : Internal ScriptStackTrace : at , : line 1 PipelineIterationInfo : diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Join-String.md b/reference/7.4/Microsoft.PowerShell.Utility/Join-String.md index 68af65827a39..a7b72db0304e 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Join-String.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Join-String.md @@ -166,7 +166,7 @@ $parms = @{ OutputSuffix = "`n}`n" Separator = "`n" } -$obj.PSObject.Properties | Join-String @parms +$obj.psobject.Properties | Join-String @parms ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Remove-Alias.md b/reference/7.4/Microsoft.PowerShell.Utility/Remove-Alias.md index 3f7c3bd30da9..ebf82bf70829 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Remove-Alias.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Remove-Alias.md @@ -45,12 +45,12 @@ This example removes all aliases from the current PowerShell session, except for other PowerShell sessions or new PowerShell sessions. ```powershell -Get-Alias | Where-Object { $_.Options -NE "Constant" } | Remove-Alias -Force +Get-Alias | Where-Object { $_.Options -ne "Constant" } | Remove-Alias -Force ``` `Get-Alias` gets all the aliases in the PowerShell session and sends the objects down the pipeline. `Where-Object` uses a script block, and the automatic variable (`$_`) and **Options** property -represent the current pipeline object. The parameter **NE** (not equal), selects objects that don't +represent the current pipeline object. The `-ne` (not equal) operator selects objects that don't have an **Options** value set to **Constant**. `Remove-Alias` uses the **Force** parameter to remove aliases, including read-only aliases, from the PowerShell session. The **Force** parameter can't remove **Constant** aliases. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md b/reference/7.4/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md index ecb947b1258f..107816b1c495 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md @@ -87,9 +87,9 @@ It uses the `Get-PSBreakpoint` cmdlet to get the breakpoints. Then, it uses a pi ### Example 5: Remove a breakpoint in a runspace -In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakPoint` is -run. The runspace is stored in a variable and passed to the `Get-PSBreakPoint` command with the -**Runspace** parameter. The output of `Get-PSBreakPoint` is piped to `Remove-PSBreakpoint` to +In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakpoint` is +run. The runspace is stored in a variable and passed to the `Get-PSBreakpoint` command with the +**Runspace** parameter. The output of `Get-PSBreakpoint` is piped to `Remove-PSBreakpoint` to remove the breakpoint in the runspace. ```powershell @@ -100,7 +100,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Remove-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Remove-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.4/ThreadJob/Start-ThreadJob.md b/reference/7.4/ThreadJob/Start-ThreadJob.md index 7ed7e138d355..ce96325c062f 100644 --- a/reference/7.4/ThreadJob/Start-ThreadJob.md +++ b/reference/7.4/ThreadJob/Start-ThreadJob.md @@ -169,7 +169,7 @@ $jobs = @() foreach ($file in $files) { $jobs += Start-ThreadJob -Name $file.OutFile -ScriptBlock { - $params = $using:file + $params = $Using:file Invoke-WebRequest @params } } diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md index d2c664da8200..c3865043f3f2 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md @@ -160,7 +160,7 @@ two cases for that meet this criteria. ```powershell (Measure-Command { - 1..1000 | ForEach { Start-ThreadJob { Write-Output "Hello $using:_" } } | Receive-Job -Wait + 1..1000 | foreach { Start-ThreadJob { Write-Output "Hello $Using:_" } } | Receive-Job -Wait }).TotalMilliseconds 36860.8226 @@ -170,13 +170,13 @@ two cases for that meet this criteria. 7.1975 ``` -The first example above shows a foreach loop that creates 1000 thread jobs to +The first example above shows a `foreach` loop that creates 1000 thread jobs to do a simple string write. Due to job overhead, it takes over 36 seconds to complete. -The second example runs the `ForEach` cmdlet to do the same 1000 operations. -This time, `ForEach-Object` runs sequentially, on a single thread, without any -job overhead. It completes in a mere 7 milliseconds. +The second example runs the `ForEach-Object` cmdlet to do the same 1000 +operations. This time, `ForEach-Object` runs sequentially, on a single thread, +without any job overhead. It completes in a mere 7 milliseconds. In the following example, up to 5000 entries are collected for 10 separate system logs. Since the script involves reading a number of logs, it makes sense @@ -201,9 +201,9 @@ The script completes in half the time when the jobs are run in parallel. ```powershell Measure-Command { - $logs = $logNames | ForEach { + $logs = $logNames | foreach { Start-ThreadJob { - Get-WinEvent -LogName $using:_ -MaxEvents 5000 2>$null + Get-WinEvent -LogName $Using:_ -MaxEvents 5000 2>$null } -ThrottleLimit 10 } | Wait-Job | Receive-Job } @@ -218,7 +218,7 @@ $logs.Count There are multiple ways to pass values into the thread-based jobs. `Start-ThreadJob` can accept variables that are piped to the cmdlet, passed in -to the script block via the `$using` keyword, or passed in via the +to the script block via the `Using:` scope modifier, or passed in via the **ArgumentList** parameter. ```powershell @@ -226,21 +226,21 @@ $msg = "Hello" $msg | Start-ThreadJob { $input | Write-Output } | Wait-Job | Receive-Job -Start-ThreadJob { Write-Output $using:msg } | Wait-Job | Receive-Job +Start-ThreadJob { Write-Output $Using:msg } | Wait-Job | Receive-Job -Start-ThreadJob { param ([string] $message) Write-Output $message } -ArgumentList @($msg) | +Start-ThreadJob { param ([string] $Message) Write-Output $Message } -ArgumentList @($msg) | Wait-Job | Receive-Job ``` `ForEach-Object -Parallel` accepts piped in variables, and variables passed -directly to the script block via the `$using` keyword. +directly to the script block via the `Using:` scope modifier. ```powershell $msg = "Hello" $msg | ForEach-Object -Parallel { Write-Output $_ } -AsJob | Wait-Job | Receive-Job -1..1 | ForEach-Object -Parallel { Write-Output $using:msg } -AsJob | Wait-Job | Receive-Job +1..1 | ForEach-Object -Parallel { Write-Output $Using:msg } -AsJob | Wait-Job | Receive-Job ``` Since thread jobs run in the same process, any variable reference type passed @@ -255,10 +255,10 @@ the process. ```powershell $threadSafeDictionary = [System.Collections.Concurrent.ConcurrentDictionary[string,object]]::new() -$jobs = Get-Process | ForEach { +$jobs = Get-Process | foreach { Start-ThreadJob { - $proc = $using:_ - $dict = $using:threadSafeDictionary + $proc = $Using:_ + $dict = $Using:threadSafeDictionary $dict.TryAdd($proc.ProcessName, $proc) } } diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md index c72ee7e23690..1b066b17a272 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md @@ -33,7 +33,7 @@ remoting and reflected into current PowerShell session. This is the same transport method used for PowerShell jobs. When a module is imported into the `WinPSCompatSession` session, implicit -remoting generates a proxy module in the user's `$env:Temp` directory and +remoting generates a proxy module in the user's `$Env:TEMP` directory and imports this proxy module into current PowerShell session. The proxy module allows PowerShell to detect that the module was loaded using Windows PowerShell Compatibility functionality. @@ -97,7 +97,7 @@ $ConfigJSON = ConvertTo-Json -InputObject @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned" } $ConfigJSON | Out-File -Force $ConfigPath -pwsh -settingsFile $ConfigPath +pwsh -SettingsFile $ConfigPath ``` For more the latest information about module compatibility, see the @@ -148,7 +148,7 @@ The Windows PowerShell Compatibility functionality: The Windows PowerShell Compatibility feature uses implicit remoting to make Windows PowerShell 5.1 modules available in PowerShell 7. Implicit remoting -creates temporary files in the `$env:Temp` directory. Each proxied module is +creates temporary files in the `$Env:TEMP` directory. Each proxied module is stored in a separate folder with the following naming convention: - `remoteIpMoProxy___localhost_`. @@ -163,6 +163,6 @@ from the session or close the session. [01]: about_Modules.md -[02]: about_Powershell_Config.md +[02]: about_PowerShell_Config.md [03]: https://aka.ms/PSModuleCompat [04]: xref:Microsoft.PowerShell.Core.Import-Module diff --git a/reference/7.5/Microsoft.PowerShell.Core/Disable-PSRemoting.md b/reference/7.5/Microsoft.PowerShell.Core/Disable-PSRemoting.md index 084c436d9bd0..efb9eb380446 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Disable-PSRemoting.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Disable-PSRemoting.md @@ -249,7 +249,7 @@ disabled. ```powershell Disable-PSRemoting -Force -powershell.exe -command 'Get-PSSessionConfiguration' +powershell.exe -Command 'Get-PSSessionConfiguration' ``` ```Output @@ -301,8 +301,8 @@ Permission : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE Acce ``` ```powershell -powershell.exe -command 'Disable-PSRemoting -Force' -powershell.exe -command 'Get-PSSessionConfiguration' +powershell.exe -Command 'Disable-PSRemoting -Force' +powershell.exe -Command 'Get-PSSessionConfiguration' ``` ```Output diff --git a/reference/7.5/Microsoft.PowerShell.Core/Get-PSSubsystem.md b/reference/7.5/Microsoft.PowerShell.Core/Get-PSSubsystem.md index ce5fecdc67e4..4b45080b4d60 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Get-PSSubsystem.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Get-PSSubsystem.md @@ -138,7 +138,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS -[about_experimental_features](About/about_Experimental_Features.md) +[about_Experimental_Features](About/about_Experimental_Features.md) [Disable-ExperimentalFeature](Disable-ExperimentalFeature.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md index 6a6388c07b6a..310b885b326b 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -57,14 +57,14 @@ Set-Clipboard -Value "This is a test string" -AsOSC52 ### Example 4: Set the default value of the **AsOSC52** parameter You can detect if you are connected to a remote session over SSH by checking the value of the -`$env:SSH_CLIENT` or `$env:SSH_TTY` environment variables. If either of these variables are set, +`$Env:SSH_CLIENT` or `$Env:SSH_TTY` environment variables. If either of these variables are set, then you are connected to a remote session over SSH. You can use this information to set the default value of the **AsOSC52** parameter. Add one of the following lines to your PowerShell profile script. ```powershell -$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $env:SSH_CLIENT -$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $env:SSH_TTY +$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $Env:SSH_CLIENT +$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $Env:SSH_TTY ``` For more information about `$PSDefaultParameterValues`, see diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md index 202811fe9306..5bc83f9e09db 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md @@ -109,7 +109,7 @@ specified in the command. For information about location stacks, see the [Notes] ### Example 5: Navigate location history using `+` or `-` ```powershell -PS C:\> Set-Location -Path $env:SystemRoot +PS C:\> Set-Location -Path $Env:SystemRoot PS C:\Windows> Set-Location -Path Cert:\ PS Cert:\> Set-Location -Path HKLM:\ PS HKLM:\> diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/7.5/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index 800952410a63..da00f2cf9c2e 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -97,9 +97,9 @@ This command disables all breakpoints in the current console. ### Example 5: Disable a breakpoint in a runspace -In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakPoint` is -run. The runspace is stored in a variable and passed to the `Get-PSBreakPoint` command with the -**Runspace** parameter. The output of `Get-PSBreakPoint` is piped to `Disable-PSBreakpoint` to +In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakpoint` is +run. The runspace is stored in a variable and passed to the `Get-PSBreakpoint` command with the +**Runspace** parameter. The output of `Get-PSBreakpoint` is piped to `Disable-PSBreakpoint` to disable the breakpoint in the runspace. ```powershell @@ -110,7 +110,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Disable-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Disable-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md b/reference/7.5/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md index 3bc612b7e767..b5e6b730fe80 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md @@ -118,8 +118,8 @@ This example is equivalent to running `Enable-PSBreakpoint -Id 3, 5`. ### Example 5: Enable a breakpoint in a runspace In this example, a job is started with a breakpoint is set to break then disabled. The runspace is -stored in a variable and passed to the `Get-PSBreakPoint` command with the **Runspace** parameter. -The output of `Get-PSBreakPoint` is piped to `Enable-PSBreakpoint` to enable the breakpoint in the +stored in a variable and passed to the `Get-PSBreakpoint` command with the **Runspace** parameter. +The output of `Get-PSBreakpoint` is piped to `Enable-PSBreakpoint` to enable the breakpoint in the runspace. ```powershell @@ -131,7 +131,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Enable-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Enable-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-Error.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-Error.md index 25147b0b6f5e..bac5248bc87b 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-Error.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-Error.md @@ -85,9 +85,9 @@ InvocationInfo : ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 57 - Line : Get-ChildItem -Path c:\NoRealDirectory + Line : Get-ChildItem -Path C:\NoRealDirectory PositionMessage : At line:1 char:1 - + Get-ChildItem -Path c:\NoRealDirectory + + Get-ChildItem -Path C:\NoRealDirectory + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ InvocationName : Get-ChildItem CommandOrigin : Internal diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Join-String.md b/reference/7.5/Microsoft.PowerShell.Utility/Join-String.md index 5cd06a58ac16..97abf5e04de5 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Join-String.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Join-String.md @@ -166,7 +166,7 @@ $parms = @{ OutputSuffix = "`n}`n" Separator = "`n" } -$obj.PSObject.Properties | Join-String @parms +$obj.psobject.Properties | Join-String @parms ``` ```Output diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Remove-Alias.md b/reference/7.5/Microsoft.PowerShell.Utility/Remove-Alias.md index baf63996ddde..e5fe1d0ded02 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Remove-Alias.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Remove-Alias.md @@ -45,12 +45,12 @@ This example removes all aliases from the current PowerShell session, except for other PowerShell sessions or new PowerShell sessions. ```powershell -Get-Alias | Where-Object { $_.Options -NE "Constant" } | Remove-Alias -Force +Get-Alias | Where-Object { $_.Options -ne "Constant" } | Remove-Alias -Force ``` `Get-Alias` gets all the aliases in the PowerShell session and sends the objects down the pipeline. `Where-Object` uses a script block, and the automatic variable (`$_`) and **Options** property -represent the current pipeline object. The parameter **NE** (not equal), selects objects that don't +represent the current pipeline object. The `-ne` (not equal) operator selects objects that don't have an **Options** value set to **Constant**. `Remove-Alias` uses the **Force** parameter to remove aliases, including read-only aliases, from the PowerShell session. The **Force** parameter can't remove **Constant** aliases. diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md b/reference/7.5/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md index 7e3b361d8db1..39c874576899 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md @@ -87,9 +87,9 @@ It uses the `Get-PSBreakpoint` cmdlet to get the breakpoints. Then, it uses a pi ### Example 5: Remove a breakpoint in a runspace -In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakPoint` is -run. The runspace is stored in a variable and passed to the `Get-PSBreakPoint` command with the -**Runspace** parameter. The output of `Get-PSBreakPoint` is piped to `Remove-PSBreakpoint` to +In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakpoint` is +run. The runspace is stored in a variable and passed to the `Get-PSBreakpoint` command with the +**Runspace** parameter. The output of `Get-PSBreakpoint` is piped to `Remove-PSBreakpoint` to remove the breakpoint in the runspace. ```powershell @@ -100,7 +100,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Remove-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Remove-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.5/ThreadJob/Start-ThreadJob.md b/reference/7.5/ThreadJob/Start-ThreadJob.md index 116aaef8f0a2..e75811c7d6b4 100644 --- a/reference/7.5/ThreadJob/Start-ThreadJob.md +++ b/reference/7.5/ThreadJob/Start-ThreadJob.md @@ -169,7 +169,7 @@ $jobs = @() foreach ($file in $files) { $jobs += Start-ThreadJob -Name $file.OutFile -ScriptBlock { - $params = $using:file + $params = $Using:file Invoke-WebRequest @params } } diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md index 983f11d46e5e..51e8f7379a8f 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Thread_Jobs.md @@ -160,7 +160,7 @@ two cases for that meet this criteria. ```powershell (Measure-Command { - 1..1000 | ForEach { Start-ThreadJob { Write-Output "Hello $using:_" } } | Receive-Job -Wait + 1..1000 | foreach { Start-ThreadJob { Write-Output "Hello $Using:_" } } | Receive-Job -Wait }).TotalMilliseconds 36860.8226 @@ -170,13 +170,13 @@ two cases for that meet this criteria. 7.1975 ``` -The first example above shows a foreach loop that creates 1000 thread jobs to +The first example above shows a `foreach` loop that creates 1000 thread jobs to do a simple string write. Due to job overhead, it takes over 36 seconds to complete. -The second example runs the `ForEach` cmdlet to do the same 1000 operations. -This time, `ForEach-Object` runs sequentially, on a single thread, without any -job overhead. It completes in a mere 7 milliseconds. +The second example runs the `ForEach-Object` cmdlet to do the same 1000 +operations. This time, `ForEach-Object` runs sequentially, on a single thread, +without any job overhead. It completes in a mere 7 milliseconds. In the following example, up to 5000 entries are collected for 10 separate system logs. Since the script involves reading a number of logs, it makes sense @@ -201,9 +201,9 @@ The script completes in half the time when the jobs are run in parallel. ```powershell Measure-Command { - $logs = $logNames | ForEach { + $logs = $logNames | foreach { Start-ThreadJob { - Get-WinEvent -LogName $using:_ -MaxEvents 5000 2>$null + Get-WinEvent -LogName $Using:_ -MaxEvents 5000 2>$null } -ThrottleLimit 10 } | Wait-Job | Receive-Job } @@ -218,7 +218,7 @@ $logs.Count There are multiple ways to pass values into the thread-based jobs. `Start-ThreadJob` can accept variables that are piped to the cmdlet, passed in -to the script block via the `$using` keyword, or passed in via the +to the script block via the `Using:` scope modifier, or passed in via the **ArgumentList** parameter. ```powershell @@ -226,21 +226,21 @@ $msg = "Hello" $msg | Start-ThreadJob { $input | Write-Output } | Wait-Job | Receive-Job -Start-ThreadJob { Write-Output $using:msg } | Wait-Job | Receive-Job +Start-ThreadJob { Write-Output $Using:msg } | Wait-Job | Receive-Job -Start-ThreadJob { param ([string] $message) Write-Output $message } -ArgumentList @($msg) | +Start-ThreadJob { param ([string] $Message) Write-Output $Message } -ArgumentList @($msg) | Wait-Job | Receive-Job ``` `ForEach-Object -Parallel` accepts piped in variables, and variables passed -directly to the script block via the `$using` keyword. +directly to the script block via the `Using:` scope modifier. ```powershell $msg = "Hello" $msg | ForEach-Object -Parallel { Write-Output $_ } -AsJob | Wait-Job | Receive-Job -1..1 | ForEach-Object -Parallel { Write-Output $using:msg } -AsJob | Wait-Job | Receive-Job +1..1 | ForEach-Object -Parallel { Write-Output $Using:msg } -AsJob | Wait-Job | Receive-Job ``` Since thread jobs run in the same process, any variable reference type passed @@ -255,10 +255,10 @@ the process. ```powershell $threadSafeDictionary = [System.Collections.Concurrent.ConcurrentDictionary[string,object]]::new() -$jobs = Get-Process | ForEach { +$jobs = Get-Process | foreach { Start-ThreadJob { - $proc = $using:_ - $dict = $using:threadSafeDictionary + $proc = $Using:_ + $dict = $Using:threadSafeDictionary $dict.TryAdd($proc.ProcessName, $proc) } } diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md index 8c4062911fde..d69fdadb64f3 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Windows_PowerShell_Compatibility.md @@ -33,7 +33,7 @@ remoting and reflected into current PowerShell session. This is the same transport method used for PowerShell jobs. When a module is imported into the `WinPSCompatSession` session, implicit -remoting generates a proxy module in the user's `$env:Temp` directory and +remoting generates a proxy module in the user's `$Env:TEMP` directory and imports this proxy module into current PowerShell session. The proxy module allows PowerShell to detect that the module was loaded using Windows PowerShell Compatibility functionality. @@ -97,7 +97,7 @@ $ConfigJSON = ConvertTo-Json -InputObject @{ "Microsoft.PowerShell:ExecutionPolicy" = "RemoteSigned" } $ConfigJSON | Out-File -Force $ConfigPath -pwsh -settingsFile $ConfigPath +pwsh -SettingsFile $ConfigPath ``` For more the latest information about module compatibility, see the @@ -148,7 +148,7 @@ The Windows PowerShell Compatibility functionality: The Windows PowerShell Compatibility feature uses implicit remoting to make Windows PowerShell 5.1 modules available in PowerShell 7. Implicit remoting -creates temporary files in the `$env:Temp` directory. Each proxied module is +creates temporary files in the `$Env:TEMP` directory. Each proxied module is stored in a separate folder with the following naming convention: - `remoteIpMoProxy___localhost_`. @@ -163,6 +163,6 @@ from the session or close the session. [01]: about_Modules.md -[02]: about_Powershell_Config.md +[02]: about_PowerShell_Config.md [03]: https://aka.ms/PSModuleCompat [04]: xref:Microsoft.PowerShell.Core.Import-Module diff --git a/reference/7.6/Microsoft.PowerShell.Core/Disable-PSRemoting.md b/reference/7.6/Microsoft.PowerShell.Core/Disable-PSRemoting.md index 27eb8f9dc764..37d7dfc9efae 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Disable-PSRemoting.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Disable-PSRemoting.md @@ -248,7 +248,7 @@ disabled. ```powershell Disable-PSRemoting -Force -powershell.exe -command 'Get-PSSessionConfiguration' +powershell.exe -Command 'Get-PSSessionConfiguration' ``` ```Output @@ -300,8 +300,8 @@ Permission : NT AUTHORITY\NETWORK AccessDenied, NT AUTHORITY\INTERACTIVE Acce ``` ```powershell -powershell.exe -command 'Disable-PSRemoting -Force' -powershell.exe -command 'Get-PSSessionConfiguration' +powershell.exe -Command 'Disable-PSRemoting -Force' +powershell.exe -Command 'Get-PSSessionConfiguration' ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Core/Get-PSSubsystem.md b/reference/7.6/Microsoft.PowerShell.Core/Get-PSSubsystem.md index 9cad9053a1c5..37daa2efed61 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Get-PSSubsystem.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Get-PSSubsystem.md @@ -138,7 +138,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS -[about_experimental_features](about/about_experimental_features.md) +[about_Experimental_Features](about/about_experimental_features.md) [Disable-ExperimentalFeature](Disable-ExperimentalFeature.md) diff --git a/reference/7.6/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7.6/Microsoft.PowerShell.Management/Set-Clipboard.md index 10dd01eeefac..4e2e15d713e8 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -57,14 +57,14 @@ Set-Clipboard -Value "This is a test string" -AsOSC52 ### Example 4: Set the default value of the **AsOSC52** parameter You can detect if you are connected to a remote session over SSH by checking the value of the -`$env:SSH_CLIENT` or `$env:SSH_TTY` environment variables. If either of these variables are set, +`$Env:SSH_CLIENT` or `$Env:SSH_TTY` environment variables. If either of these variables are set, then you are connected to a remote session over SSH. You can use this information to set the default value of the **AsOSC52** parameter. Add one of the following lines to your PowerShell profile script. ```powershell -$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $env:SSH_CLIENT -$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $env:SSH_TTY +$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $Env:SSH_CLIENT +$PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $Env:SSH_TTY ``` For more information about `$PSDefaultParameterValues`, see diff --git a/reference/7.6/Microsoft.PowerShell.Management/Set-Location.md b/reference/7.6/Microsoft.PowerShell.Management/Set-Location.md index 621e583b386c..5b7a45c09689 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Set-Location.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Set-Location.md @@ -109,7 +109,7 @@ specified in the command. For information about location stacks, see the [Notes] ### Example 5: Navigate location history using `+` or `-` ``` -PS C:\> Set-Location -Path $env:SystemRoot +PS C:\> Set-Location -Path $Env:SystemRoot PS C:\Windows> Set-Location -Path Cert:\ PS Cert:\> Set-Location -Path HKLM:\ PS HKLM:\> diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index b53789f87aeb..0a319ce314e8 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -97,9 +97,9 @@ This command disables all breakpoints in the current console. ### Example 5: Disable a breakpoint in a runspace -In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakPoint` is -run. The runspace is stored in a variable and passed to the `Get-PSBreakPoint` command with the -**Runspace** parameter. The output of `Get-PSBreakPoint` is piped to `Disable-PSBreakpoint` to +In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakpoint` is +run. The runspace is stored in a variable and passed to the `Get-PSBreakpoint` command with the +**Runspace** parameter. The output of `Get-PSBreakpoint` is piped to `Disable-PSBreakpoint` to disable the breakpoint in the runspace. ```powershell @@ -110,7 +110,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Disable-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Disable-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md b/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md index 059c6100a122..01eca22dab04 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md @@ -118,8 +118,8 @@ This example is equivalent to running `Enable-PSBreakpoint -Id 3, 5`. ### Example 5: Enable a breakpoint in a runspace In this example, a job is started with a breakpoint is set to break then disabled. The runspace is -stored in a variable and passed to the `Get-PSBreakPoint` command with the **Runspace** parameter. -The output of `Get-PSBreakPoint` is piped to `Enable-PSBreakpoint` to enable the breakpoint in the +stored in a variable and passed to the `Get-PSBreakpoint` command with the **Runspace** parameter. +The output of `Get-PSBreakpoint` is piped to `Enable-PSBreakpoint` to enable the breakpoint in the runspace. ```powershell @@ -131,7 +131,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Enable-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Enable-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md index 49a7ff76896c..e988122d6fdc 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md @@ -47,7 +47,7 @@ In this example, `Get-Error` displays the details of the most recent error that current session. ```powershell -Get-ChildItem -path /NoRealDirectory +Get-ChildItem -Path /NoRealDirectory Get-Error ``` @@ -86,9 +86,9 @@ InvocationInfo : ScriptLineNumber : 1 OffsetInLine : 1 HistoryId : 57 - Line : Get-ChildItem -path c:\NoRealDirectory + Line : Get-ChildItem -Path C:\NoRealDirectory PositionMessage : At line:1 char:1 - + Get-ChildItem -path c:\NoRealDirectory + + Get-ChildItem -Path C:\NoRealDirectory + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ InvocationName : Get-ChildItem CommandOrigin : Internal diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Join-String.md b/reference/7.6/Microsoft.PowerShell.Utility/Join-String.md index 6973c21295a7..21575b909707 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Join-String.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Join-String.md @@ -166,7 +166,7 @@ $parms = @{ OutputSuffix = "`n}`n" Separator = "`n" } -$obj.PSObject.Properties | Join-String @parms +$obj.psobject.Properties | Join-String @parms ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Remove-Alias.md b/reference/7.6/Microsoft.PowerShell.Utility/Remove-Alias.md index 4d6f2e533f6b..27796c3ab9d4 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Remove-Alias.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Remove-Alias.md @@ -45,12 +45,12 @@ This example removes all aliases from the current PowerShell session, except for other PowerShell sessions or new PowerShell sessions. ```powershell -Get-Alias | Where-Object { $_.Options -NE "Constant" } | Remove-Alias -Force +Get-Alias | Where-Object { $_.Options -ne "Constant" } | Remove-Alias -Force ``` `Get-Alias` gets all the aliases in the PowerShell session and sends the objects down the pipeline. `Where-Object` uses a script block, and the automatic variable (`$_`) and **Options** property -represent the current pipeline object. The parameter **NE** (not equal), selects objects that don't +represent the current pipeline object. The `-ne` (not equal) operator selects objects that don't have an **Options** value set to **Constant**. `Remove-Alias` uses the **Force** parameter to remove aliases, including read-only aliases, from the PowerShell session. The **Force** parameter can't remove **Constant** aliases. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md b/reference/7.6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md index 81490d24ded1..24988206e1cb 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md @@ -87,9 +87,9 @@ It uses the `Get-PSBreakpoint` cmdlet to get the breakpoints. Then, it uses a pi ### Example 5: Remove a breakpoint in a runspace -In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakPoint` is -run. The runspace is stored in a variable and passed to the `Get-PSBreakPoint` command with the -**Runspace** parameter. The output of `Get-PSBreakPoint` is piped to `Remove-PSBreakpoint` to +In this example, a job is started and a breakpoint is set to break when the `Set-PSBreakpoint` is +run. The runspace is stored in a variable and passed to the `Get-PSBreakpoint` command with the +**Runspace** parameter. The output of `Get-PSBreakpoint` is piped to `Remove-PSBreakpoint` to remove the breakpoint in the runspace. ```powershell @@ -100,7 +100,7 @@ Start-Job -ScriptBlock { $runspace = Get-Runspace -Id 1 -Get-PSBreakPoint -Runspace $runspace | Remove-Breakpoint -Runspace $runspace +Get-PSBreakpoint -Runspace $runspace | Remove-Breakpoint -Runspace $runspace ``` ## PARAMETERS diff --git a/reference/7.6/ThreadJob/Start-ThreadJob.md b/reference/7.6/ThreadJob/Start-ThreadJob.md index 14fa64c7df15..c16988e82ffb 100644 --- a/reference/7.6/ThreadJob/Start-ThreadJob.md +++ b/reference/7.6/ThreadJob/Start-ThreadJob.md @@ -169,7 +169,7 @@ $jobs = @() foreach ($file in $files) { $jobs += Start-ThreadJob -Name $file.OutFile -ScriptBlock { - $params = $using:file + $params = $Using:file Invoke-WebRequest @params } }