diff --git a/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md b/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md index e272f2f1b84c..9ec9198589b7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md @@ -42,7 +42,7 @@ for a module or if your help files are outdated, `Update-Help` downloads the new help files can be downloaded and installed from the internet or a file share. Without parameters, `Update-Help` updates the help files for modules that support updateable help -and are loaded in the session or installed in a location included in the `$env:PSModulePath`. For +and are loaded in the session or installed in a location included in the `$Env:PSModulePath`. For more information, see [about_Updatable_Help](./About/about_Updatable_Help.md). `Update-Help` checks the version of the help installed. If `Update-Help` can't find updated help @@ -214,7 +214,7 @@ Get-Module -ListAvailable | Where-Object -Property HelpInfoUri ``` ```output - Directory: C:\program files\powershell\6\Modules + Directory: C:\Program Files\PowerShell\6\Modules ModuleType Version Name PSEdition ExportedCommands ---------- ------- ---- --------- ---------------- @@ -244,9 +244,9 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 -Param( - [parameter(Mandatory=$false)] - [String[]] +param ( + [Parameter(Mandatory=$false)] + [string[]] $Module ) $HelpInfoNamespace = @{helpInfo='http://schemas.microsoft.com/powershell/help/2010/05'} @@ -268,7 +268,7 @@ foreach ($mModule in $Modules) $mCulture=$mNode.Node.UICultureName $mVer=$mNode.Node.UICultureVersion - [PSCustomObject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} + [pscustomobject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} } } } @@ -419,7 +419,7 @@ are permitted. You can pipeline modules from the `Get-Module` cmdlet to the `Upd The modules that you specify must be installed on the computer, but they don't have to be imported into the current session. You can specify any module in the session or any module that's installed -in a location listed in the `$env:PSModulePath` environment variable. +in a location listed in the `$Env:PSModulePath` environment variable. A value of `*` (all) attempts to update help for all modules that are installed on the computer. Modules that don't support Updatable Help are included. This value might generate errors when the @@ -427,7 +427,7 @@ command encounters modules that don't support Updatable Help. Instead, run `Upda parameters. The **Module** parameter of the `Update-Help` cmdlet doesn't accept the full path of a module file -or module manifest file. To update help for a module that isn't in a `$env:PSModulePath` location, +or module manifest file. To update help for a module that isn't in a `$Env:PSModulePath` location, import the module into the current session before you run the `Update-Help` command. ```yaml @@ -618,7 +618,7 @@ for HTTP and port 443 for HTTPS. `Update-Help` supports all modules and the core PowerShell snap-ins. It doesn't support any other snap-ins. -To update help for a module in a location that isn't listed in the `$env:PSModulePath` environment +To update help for a module in a location that isn't listed in the `$Env:PSModulePath` environment variable, import the module into the current session and then run an `Update-Help` command. Run `Update-Help` without parameters or use the **Module** parameter to specify the module name. The **Module** parameter of the `Update-Help` and `Save-Help` cmdlets doesn't accept the full path of a diff --git a/reference/5.1/Microsoft.PowerShell.Core/Wait-Job.md b/reference/5.1/Microsoft.PowerShell.Core/Wait-Job.md index 0b008bb89457..9b6a4a9462dc 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Wait-Job.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Wait-Job.md @@ -144,9 +144,9 @@ The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c` variable. -The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the -local computer. The **Using** scope modifier is introduced in Windows PowerShell 3.0. For more -information about the **Using** scope modifier, see +The command uses the `Using:` scope modifier to indicate that the `$c` variable was defined on the +local computer. The `Using:` scope modifier is introduced in Windows PowerShell 3.0. For more +information about the `Using:` scope modifier, see [about_Remote_Variables](./about/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the @@ -184,7 +184,7 @@ The `$done` variable contains a job object that represents the job that ran on S ### Example 5: Wait until one of several jobs finishes ```powershell -Wait-Job -id 1,2,5 -Any +Wait-Job -Id 1,2,5 -Any ``` This command identifies three jobs by their IDs and waits until any one of them are in a terminating @@ -222,7 +222,7 @@ These commands start a job that gets the Windows PowerShell script files that we in the last week. The first command uses `Start-Job` to start a job on the local computer. The job runs a -`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were +`Get-ChildItem` command that gets all of the files that have a `.ps1` file name extension that were added or updated in the last week. The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job @@ -265,7 +265,7 @@ Get-Job ```Output Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- -1 Job1 Completed True localhost,Server01.. get-service +1 Job1 Completed True localhost,Server01.. Get-Service 4 Job4 Completed True localhost dir | where ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md index 7452728cc2e0..35ce5bc2884c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md @@ -302,20 +302,20 @@ These commands list processes that have a working set greater than 250 megabytes filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.WorkingSet -GT 250MB } +Get-Process | Where-Object { $_.WorkingSet -gt 250MB } Get-Process | Where-Object WorkingSet -GT 250MB ``` ### Example 3: Get processes based on process name These commands get the processes that have a **ProcessName** property value that begins with the -letter `p`. The **Match** operator lets you use regular expression matches. +letter `p`. The `-match` operator and **Match** parameter let you use regular expression matches. The commands filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.ProcessName -Match "^p.*" } +Get-Process | Where-Object { $_.ProcessName -match "^p.*" } Get-Process | Where-Object ProcessName -Match "^p.*" ``` @@ -370,7 +370,7 @@ Get-ChildItem | Where-Object { $_.PSIsContainer } Get-ChildItem | Where-Object { !$_.PSIsContainer } # You cannot use the -not operator (!) in the comparison statement format # of the command. -Get-ChildItem | Where-Object PSIsContainer -eq $false +Get-ChildItem | Where-Object PSIsContainer -EQ $false ``` ### Example 6: Use multiple conditions @@ -807,7 +807,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value matches any of the specified values. For example: -`Get-Process | Where-Object -Property ProcessName -in -Value "Svchost", "TaskHost", "WsmProvHost"` +`Get-Process | Where-Object -Property ProcessName -In -Value "Svchost", "TaskHost", "WsmProvHost"` If the input is a single object, PowerShell converts it to a collection of one object. @@ -859,7 +859,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET type. Enclose the type name in square brackets. -For example, `Get-Process | Where-Object StartTime -Is [DateTime]` +For example, `Get-Process | Where-Object StartTime -Is [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -880,7 +880,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value isn't an instance of the specified .NET type. -For example, `Get-Process | where StartTime -IsNot [DateTime]` +For example, `Get-Process | where StartTime -IsNot [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -1073,7 +1073,7 @@ Indicates that this cmdlet gets objects when the property value doesn't match th expression. When the input is a single object, the matched value is saved in the `$Matches` automatic variable. -For example: `Get-Process | Where-Object ProcessName -NotMatch "PowerShell"` +For example: `Get-Process | Where-Object ProcessName -NotMatch "powershell"` This parameter was introduced in Windows PowerShell 3.0. @@ -1161,7 +1161,7 @@ Windows PowerShell includes the following aliases for `Where-Object`: Starting in Windows PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections. -You can read more about these methods here [about_arrays](./About/about_Arrays.md) +You can read more about these methods here [about_Arrays](./About/about_Arrays.md) ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md index 67f2245df124..a31fffc8241f 100644 --- a/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -190,10 +190,10 @@ $DiskReads | Get-Counter -ComputerName Server01, Server02 -MaxSamples 10 ```Output Timestamp CounterSamples --------- -------------- -6/21/2019 10:51:04 \\Server01\logicaldisk(c:)\disk reads/sec : +6/21/2019 10:51:04 \\Server01\logicaldisk(C:)\disk reads/sec : 0 - \\Server02\logicaldisk(c:)\disk reads/sec : + \\Server02\logicaldisk(C:)\disk reads/sec : 0.983050344269146 ``` diff --git a/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md b/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md index 86d643d9fad6..0e7744168ee8 100644 --- a/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md @@ -230,15 +230,15 @@ is a property of the object with a non-null value. ### Example 5: Get event logs from multiple servers This example gets objects that represent the **Application** event logs on three computers: -Server01, Server02, and Server03. The **ForEach** keyword is used because the **ComputerName** +Server01, Server02, and Server03. The `foreach` keyword is used because the **ComputerName** parameter accepts only one value. For more information, see [about_Foreach](../Microsoft.PowerShell.Core/about/about_Foreach.md). ```powershell $S = 'Server01', 'Server02', 'Server03' -ForEach ($Server in $S) { +foreach ($Server in $S) { Get-WinEvent -ListLog Application -ComputerName $Server | Select-Object LogMode, MaximumSizeInBytes, RecordCount, LogName, - @{name='ComputerName'; expression={$Server}} | + @{Name='ComputerName'; Expression={$Server}} | Format-Table -AutoSize } ``` @@ -252,7 +252,7 @@ Circular 15532032 5309 Application Server03 ``` The variable `$S` stores the names three servers: **Server01**, **Server02**, and **Server03**. The -**ForEach** statement uses a loop to process each server, `($Server in $S)`. The script block in the +`foreach` statement uses a loop to process each server, `($Server in $S)`. The script block in the curly braces (`{ }`) runs the `Get-WinEvent` command. The **ListLog** parameter specifies the **Application** log. The **ComputerName** parameter uses the variable `$Server` to get log information from each server. @@ -671,7 +671,7 @@ Hash table queries have the following rules: - The **Path** value takes paths to `.etl`, `.evt`, and `.evtx` log files. - The **LogName**, **Path**, and **ProviderName** keys can be used in the same query. - The **UserID** key can take a valid security identifier (SID) or a domain account name that can be - used to construct a valid **System.Security.Principal.NTAccount object**. + used to construct a valid **System.Security.Principal.NTAccount** object. - The **Data** value takes event data in an unnamed field. For example, events in classic event logs. @@ -752,7 +752,7 @@ Accept wildcard characters: False ### -Force Gets debug and analytic logs, in addition to other event logs. The **Force** parameter is required -to get a debug or analytic log when the value of the name parameter includes wildcard characters. +to get a debug or analytic log when the value of the Name parameter includes wildcard characters. By default, the `Get-WinEvent` cmdlet excludes these logs unless you specify the full name of a debug or analytic log. @@ -816,7 +816,7 @@ cmdlet. > PowerShell does not limit the amount of logs you can request. However, the `Get-WinEvent` cmdlet > queries the Windows API which has a limit of 256. This can make it difficult to filter through all > of your logs at one time. You can work around this by using a `foreach` loop to iterate through each -> log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.Logname }` +> log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.LogName }` ```yaml Type: System.String[] diff --git a/reference/5.1/Microsoft.PowerShell.Diagnostics/New-WinEvent.md b/reference/5.1/Microsoft.PowerShell.Diagnostics/New-WinEvent.md index b63a6bd813db..21a9e07fef5d 100644 --- a/reference/5.1/Microsoft.PowerShell.Diagnostics/New-WinEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Diagnostics/New-WinEvent.md @@ -45,7 +45,7 @@ In version 0, the **IsMachine** field is a boolean value. In version 1, the **Is an unsigned integer value. ```powershell -(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -eq 8007 +(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -EQ 8007 ``` ```Output @@ -94,9 +94,9 @@ to the **PolicyElaspedTimeInSeconds** field. This example shows how to create an event using a specific template version. ```powershell -$Payload = @(300, [uint32]'0x8001011f', $env:USERNAME, 0, 1) +$Payload = @(300, [uint32]'0x8001011f', $Env:USERNAME, 0, 1) New-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -Id 8007 -Version 1 -Payload $Payload -Get-winEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 +Get-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 ``` ```Output diff --git a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md index 1fc16acad8f0..ef825823fae3 100644 --- a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md @@ -85,13 +85,13 @@ running PowerShell, the version of PowerShell, and the date and time. The transc the `\\Server01\Transcripts` file share. ```powershell -$sharepath = '\\Server01\Transcripts' -$username = $env:USERNAME +$sharePath = '\\Server01\Transcripts' +$username = $Env:USERNAME $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() -$datetime = Get-Date -f 'yyyyMMddHHmmss' +$datetime = Get-Date -F 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = (Join-Path -Path $sharepath -ChildPath $filename).ToString() +$Transcript = (Join-Path -Path $sharePath -ChildPath $filename).ToString() Start-Transcript ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Clear-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Clear-Content.md index 9c8216ac4b0f..e649c1b5475a 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Clear-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Clear-Content.md @@ -272,7 +272,7 @@ Accept wildcard characters: False Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see -[about_transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). +[about_Transactions](../Microsoft.PowerShell.Core/About/about_Transactions.md). ```yaml Type: System.Management.Automation.SwitchParameter @@ -348,7 +348,7 @@ manipulate content. To clear items that are not considered to be content, such a the PowerShell Certificate or Registry providers, use `Clear-Item`. The `Clear-Content` cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. +To list the providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Clear-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Clear-Item.md index 7cca11c10739..6da83919b051 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Clear-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Clear-Item.md @@ -291,7 +291,7 @@ Windows PowerShell includes the following aliases for `Clear-Item`: - The `Clear-Item` cmdlet is supported only by several PowerShell providers, including the **Alias**, **Environment**, **Function**, **Registry**, and **Variable** providers. As such, you can use `Clear-Item` to delete the content of items in the provider namespaces. To list the - providers available in your session, type `Get-PsProvider`. For more information, see + providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). - You cannot use `Clear-Item` to delete the contents of a file, because the PowerShell FileSystem provider does not support this cmdlet. To clear files, use the `Clear-Content`. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Debug-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Debug-Process.md index 7689141fb866..1f3da13a75dd 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Debug-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Debug-Process.md @@ -47,7 +47,7 @@ verify that a debugger is installed and configured. ### Example 1: Attach a debugger to a process on the computer ```powershell -Debug-Process -Name Powershell +Debug-Process -Name powershell ``` This command attaches a debugger to the PowerShell process on the computer. @@ -80,14 +80,14 @@ This command attaches a debugger to the processes that have process IDs 1132 and ### Example 5: Use Get-Process to get a process then attach a debugger to it ```powershell -Get-Process PowerShell | Debug-Process +Get-Process powershell | Debug-Process ``` This command attaches a debugger to the PowerShell processes on the computer. It uses the `Get-Process` cmdlet to get the PowerShell processes on the computer, and it uses a pipeline operator (`|`) to send the processes to the `Debug-Process` cmdlet. -To specify a particular PowerShell process, use the ID parameter of `Get-Process`. +To specify a particular PowerShell process, use the **Id** parameter of `Get-Process`. ### Example 6: Attach a debugger to a current process on the local computer @@ -119,7 +119,7 @@ attaches the debuggers. ### Example 8: Attach a debugger to a process that uses the InputObject parameter ```powershell -$P = Get-Process PowerShell +$P = Get-Process powershell Debug-Process -InputObject $P ``` @@ -249,7 +249,7 @@ This cmdlet returns no output. ## NOTES This cmdlet uses the AttachDebugger method of the Windows Management Instrumentation (WMI) -Win32_Process class. For more information about this method, see +**Win32_Process** class. For more information about this method, see [AttachDebugger method](https://go.microsoft.com/fwlink/?LinkId=143640) in the MSDN library. ## RELATED LINKS diff --git a/reference/7.4/Microsoft.PowerShell.Core/Update-Help.md b/reference/7.4/Microsoft.PowerShell.Core/Update-Help.md index e426c0fe4409..2fdea912d3f8 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Update-Help.md @@ -44,7 +44,7 @@ for a module or if your help files are outdated, `Update-Help` downloads the new help files can be downloaded and installed from the internet or a file share. Without parameters, `Update-Help` updates the help files for modules that support updateable help -and are loaded in the session or installed in a location included in the `$env:PSModulePath`. For +and are loaded in the session or installed in a location included in the `$Env:PSModulePath`. For more information, see [about_Updatable_Help](./About/about_Updatable_Help.md). `Update-Help` checks the version of the help installed. If `Update-Help` can't find updated help @@ -162,7 +162,7 @@ Get-Module -ListAvailable | Where-Object -Property HelpInfoUri ``` ```output - Directory: C:\program files\powershell\6\Modules + Directory: C:\Program Files\PowerShell\6\Modules ModuleType Version Name PSEdition ExportedCommands ---------- ------- ---- --------- ---------------- @@ -192,9 +192,9 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 -Param( - [parameter(Mandatory=$false)] - [String[]] +param ( + [Parameter(Mandatory=$false)] + [string[]] $Module ) $HelpInfoNamespace = @{helpInfo='http://schemas.microsoft.com/powershell/help/2010/05'} @@ -216,7 +216,7 @@ foreach ($mModule in $Modules) $mCulture=$mNode.Node.UICultureName $mVer=$mNode.Node.UICultureVersion - [PSCustomObject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} + [pscustomobject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} } } } @@ -367,7 +367,7 @@ are permitted. You can pipeline modules from the `Get-Module` cmdlet to the `Upd The modules that you specify must be installed on the computer, but they don't have to be imported into the current session. You can specify any module in the session or any module that's installed -in a location listed in the `$env:PSModulePath` environment variable. +in a location listed in the `$Env:PSModulePath` environment variable. A value of `*` (all) attempts to update help for all modules that are installed on the computer. Modules that don't support Updatable Help are included. This value might generate errors when the @@ -375,7 +375,7 @@ command encounters modules that don't support Updatable Help. Instead, run `Upda parameters. The **Module** parameter of the `Update-Help` cmdlet doesn't accept the full path of a module file -or module manifest file. To update help for a module that isn't in a `$env:PSModulePath` location, +or module manifest file. To update help for a module that isn't in a `$Env:PSModulePath` location, import the module into the current session before you run the `Update-Help` command. ```yaml @@ -598,7 +598,7 @@ for HTTP and port 443 for HTTPS. `Update-Help` supports all modules and the core PowerShell snap-ins. It doesn't support any other snap-ins. -To update help for a module in a location that isn't listed in the `$env:PSModulePath` environment +To update help for a module in a location that isn't listed in the `$Env:PSModulePath` environment variable, import the module into the current session and then run an `Update-Help` command. Run `Update-Help` without parameters or use the **Module** parameter to specify the module name. The **Module** parameter of the `Update-Help` and `Save-Help` cmdlets doesn't accept the full path of a diff --git a/reference/7.4/Microsoft.PowerShell.Core/Wait-Job.md b/reference/7.4/Microsoft.PowerShell.Core/Wait-Job.md index 52b9697b3b19..9d3de686d80c 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Wait-Job.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Wait-Job.md @@ -144,9 +144,9 @@ The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c` variable. -The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the -local computer. The **Using** scope modifier is introduced in Windows PowerShell 3.0. For more -information about the **Using** scope modifier, see +The command uses the `Using:` scope modifier to indicate that the `$c` variable was defined on the +local computer. The `Using:` scope modifier is introduced in Windows PowerShell 3.0. For more +information about the `Using:` scope modifier, see [about_Remote_Variables](./about/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the @@ -184,7 +184,7 @@ The `$done` variable contains a job object that represents the job that ran on S ### Example 5: Wait until one of several jobs finishes ```powershell -Wait-Job -id 1,2,5 -Any +Wait-Job -Id 1,2,5 -Any ``` This command identifies three jobs by their IDs and waits until any one of them are in a terminating @@ -222,7 +222,7 @@ These commands start a job that gets the Windows PowerShell script files that we in the last week. The first command uses `Start-Job` to start a job on the local computer. The job runs a -`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were +`Get-ChildItem` command that gets all of the files that have a `.ps1` file name extension that were added or updated in the last week. The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job @@ -265,7 +265,7 @@ Get-Job ```Output Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- -1 Job1 Completed True localhost,Server01.. get-service +1 Job1 Completed True localhost,Server01.. Get-Service 4 Job4 Completed True localhost dir | where ``` diff --git a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md index 34bc9d605362..de3d34975f8c 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Core/Where-Object.md @@ -309,20 +309,20 @@ These commands list processes that have a working set greater than 250 megabytes filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.WorkingSet -GT 250MB } +Get-Process | Where-Object { $_.WorkingSet -gt 250MB } Get-Process | Where-Object WorkingSet -GT 250MB ``` ### Example 3: Get processes based on process name These commands get the processes that have a **ProcessName** property value that begins with the -letter `p`. The **Match** operator lets you use regular expression matches. +letter `p`. The `-match` operator and **Match** parameter let you use regular expression matches. The commands filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.ProcessName -Match "^p.*" } +Get-Process | Where-Object { $_.ProcessName -match "^p.*" } Get-Process | Where-Object ProcessName -Match "^p.*" ``` @@ -812,7 +812,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value matches any of the specified values. For example: -`Get-Process | Where-Object -Property ProcessName -in -Value "Svchost", "TaskHost", "WsmProvHost"` +`Get-Process | Where-Object -Property ProcessName -In -Value "Svchost", "TaskHost", "WsmProvHost"` If the input is a single object, PowerShell converts it to a collection of one object. @@ -864,7 +864,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET type. Enclose the type name in square brackets. -For example, `Get-Process | Where-Object StartTime -Is [DateTime]` +For example, `Get-Process | Where-Object StartTime -Is [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -885,7 +885,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value isn't an instance of the specified .NET type. -For example, `Get-Process | where StartTime -IsNot [DateTime]` +For example, `Get-Process | where StartTime -IsNot [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -1099,7 +1099,7 @@ Indicates that this cmdlet gets objects when the property value doesn't match th expression. When the input is a single object, the matched value is saved in the `$Matches` automatic variable. -For example: `Get-Process | Where-Object ProcessName -NotMatch "PowerShell"` +For example: `Get-Process | Where-Object ProcessName -NotMatch "powershell"` This parameter was introduced in Windows PowerShell 3.0. @@ -1188,7 +1188,7 @@ PowerShell includes the following aliases for `Where-Object`: Starting in Windows PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections. -You can read more about these methods here [about_arrays](./About/about_Arrays.md) +You can read more about these methods here [about_Arrays](./About/about_Arrays.md) ## RELATED LINKS diff --git a/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-Counter.md index 5dd3301dba8c..3f4cea0e6fee 100644 --- a/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -196,10 +196,10 @@ $DiskReads | Get-Counter -ComputerName Server01, Server02 -MaxSamples 10 ```Output Timestamp CounterSamples --------- -------------- -6/21/2019 10:51:04 \\Server01\logicaldisk(c:)\disk reads/sec : +6/21/2019 10:51:04 \\Server01\logicaldisk(C:)\disk reads/sec : 0 - \\Server02\logicaldisk(c:)\disk reads/sec : + \\Server02\logicaldisk(C:)\disk reads/sec : 0.983050344269146 ``` diff --git a/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md b/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md index ec840ecf8c8c..3b8e233390e8 100644 --- a/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md @@ -232,15 +232,15 @@ is a property of the object with a non-null value. ### Example 5: Get event logs from multiple servers This example gets objects that represent the **Application** event logs on three computers: -Server01, Server02, and Server03. The **ForEach** keyword is used because the **ComputerName** +Server01, Server02, and Server03. The `foreach` keyword is used because the **ComputerName** parameter accepts only one value. For more information, see [about_Foreach](../Microsoft.PowerShell.Core/about/about_Foreach.md). ```powershell $S = 'Server01', 'Server02', 'Server03' -ForEach ($Server in $S) { +foreach ($Server in $S) { Get-WinEvent -ListLog Application -ComputerName $Server | Select-Object LogMode, MaximumSizeInBytes, RecordCount, LogName, - @{name='ComputerName'; expression={$Server}} | + @{Name='ComputerName'; Expression={$Server}} | Format-Table -AutoSize } ``` @@ -254,7 +254,7 @@ Circular 15532032 5309 Application Server03 ``` The variable `$S` stores the names three servers: **Server01**, **Server02**, and **Server03**. The -**ForEach** statement uses a loop to process each server, `($Server in $S)`. The script block in the +`foreach` statement uses a loop to process each server, `($Server in $S)`. The script block in the curly braces (`{ }`) runs the `Get-WinEvent` command. The **ListLog** parameter specifies the **Application** log. The **ComputerName** parameter uses the variable `$Server` to get log information from each server. @@ -692,7 +692,7 @@ Hash table queries have the following rules: - The **Path** value takes paths to `.etl`, `.evt`, and `.evtx` log files. - The **LogName**, **Path**, and **ProviderName** keys can be used in the same query. - The **UserID** key can take a valid security identifier (SID) or a domain account name that can be - used to construct a valid **System.Security.Principal.NTAccount object**. + used to construct a valid **System.Security.Principal.NTAccount** object. - The **Data** value takes event data in an unnamed field. For example, events in classic event logs. - `` key represents a named event data field. @@ -778,7 +778,7 @@ Accept wildcard characters: False ### -Force Gets debug and analytic logs, in addition to other event logs. The **Force** parameter is required -to get a debug or analytic log when the value of the name parameter includes wildcard characters. +to get a debug or analytic log when the value of the Name parameter includes wildcard characters. By default, the `Get-WinEvent` cmdlet excludes these logs unless you specify the full name of a debug or analytic log. @@ -842,7 +842,7 @@ cmdlet. > PowerShell does not limit the amount of logs you can request. However, the `Get-WinEvent` cmdlet > queries the Windows API which has a limit of 256. This can make it difficult to filter through all > of your logs at one time. You can work around this by using a `foreach` loop to iterate through each -> log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.Logname }` +> log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.LogName }` ```yaml Type: System.String[] diff --git a/reference/7.4/Microsoft.PowerShell.Diagnostics/New-WinEvent.md b/reference/7.4/Microsoft.PowerShell.Diagnostics/New-WinEvent.md index e56d3a0317bd..f97504225ca7 100644 --- a/reference/7.4/Microsoft.PowerShell.Diagnostics/New-WinEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Diagnostics/New-WinEvent.md @@ -47,7 +47,7 @@ In version 0, the **IsMachine** field is a boolean value. In version 1, the **Is an unsigned integer value. ```powershell -(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -eq 8007 +(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -EQ 8007 ``` ```Output @@ -96,9 +96,9 @@ to the **PolicyElaspedTimeInSeconds** field. This example shows how to create an event using a specific template version. ```powershell -$Payload = @(300, [uint32]'0x8001011f', $env:USERNAME, 0, 1) +$Payload = @(300, [uint32]'0x8001011f', $Env:USERNAME, 0, 1) New-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -Id 8007 -Version 1 -Payload $Payload -Get-winEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 +Get-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md index 775c001aec00..890ffd504afc 100644 --- a/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md @@ -86,13 +86,13 @@ running PowerShell, the version of PowerShell, and the date and time. The transc the `\\Server01\Transcripts` file share. ```powershell -$sharepath = '\\Server01\Transcripts' -$username = $env:USERNAME +$sharePath = '\\Server01\Transcripts' +$username = $Env:USERNAME $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() -$datetime = Get-Date -f 'yyyyMMddHHmmss' +$datetime = Get-Date -F 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = (Join-Path -Path $sharepath -ChildPath $filename).ToString() +$Transcript = (Join-Path -Path $sharePath -ChildPath $filename).ToString() Start-Transcript ``` diff --git a/reference/7.4/Microsoft.PowerShell.Management/Clear-Content.md b/reference/7.4/Microsoft.PowerShell.Management/Clear-Content.md index 54762456baef..f92b919f790f 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Clear-Content.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Clear-Content.md @@ -333,7 +333,7 @@ manipulate content. To clear items that are not considered to be content, such a the PowerShell Certificate or Registry providers, use `Clear-Item`. The `Clear-Content` cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. +To list the providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.4/Microsoft.PowerShell.Management/Clear-Item.md b/reference/7.4/Microsoft.PowerShell.Management/Clear-Item.md index d2df9e07003a..4af9074f474d 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Clear-Item.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Clear-Item.md @@ -274,7 +274,7 @@ PowerShell includes the following aliases for `Clear-Item`: - The `Clear-Item` cmdlet is supported only by several PowerShell providers, including the **Alias**, **Environment**, **Function**, **Registry**, and **Variable** providers. As such, you can use `Clear-Item` to delete the content of items in the provider namespaces. To list the - providers available in your session, type `Get-PsProvider`. For more information, see + providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). - You cannot use `Clear-Item` to delete the contents of a file, because the PowerShell FileSystem provider does not support this cmdlet. To clear files, use the `Clear-Content`. diff --git a/reference/7.4/Microsoft.PowerShell.Management/Debug-Process.md b/reference/7.4/Microsoft.PowerShell.Management/Debug-Process.md index b55431d4e7b0..cadfd2ab38d6 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Debug-Process.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Debug-Process.md @@ -47,7 +47,7 @@ verify that a debugger is installed and configured. ### Example 1: Attach a debugger to a process on the computer ```powershell -Debug-Process -Name Powershell +Debug-Process -Name powershell ``` This command attaches a debugger to the PowerShell process on the computer. @@ -80,14 +80,14 @@ This command attaches a debugger to the processes that have process IDs 1132 and ### Example 5: Use Get-Process to get a process then attach a debugger to it ```powershell -Get-Process PowerShell | Debug-Process +Get-Process powershell | Debug-Process ``` This command attaches a debugger to the PowerShell processes on the computer. It uses the `Get-Process` cmdlet to get the PowerShell processes on the computer, and it uses a pipeline operator (`|`) to send the processes to the `Debug-Process` cmdlet. -To specify a particular PowerShell process, use the ID parameter of `Get-Process`. +To specify a particular PowerShell process, use the **Id** parameter of `Get-Process`. ### Example 6: Attach a debugger to a current process on the local computer @@ -107,7 +107,7 @@ For more information about the `$PID` automatic variable, see ### Example 7: Attach a debugger to a process that uses the InputObject parameter ```powershell -$P = Get-Process PowerShell +$P = Get-Process powershell Debug-Process -InputObject $P ``` @@ -237,7 +237,7 @@ This cmdlet returns no output. ## NOTES This cmdlet uses the AttachDebugger method of the Windows Management Instrumentation (WMI) -Win32_Process class. For more information about this method, see +**Win32_Process** class. For more information about this method, see [AttachDebugger method](https://go.microsoft.com/fwlink/?LinkId=143640) in the MSDN library. ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Core/Update-Help.md b/reference/7.5/Microsoft.PowerShell.Core/Update-Help.md index 866e6810d96c..be098d9ab9e8 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Update-Help.md @@ -44,7 +44,7 @@ for a module or if your help files are outdated, `Update-Help` downloads the new help files can be downloaded and installed from the internet or a file share. Without parameters, `Update-Help` updates the help files for modules that support updateable help -and are loaded in the session or installed in a location included in the `$env:PSModulePath`. For +and are loaded in the session or installed in a location included in the `$Env:PSModulePath`. For more information, see [about_Updatable_Help](About/about_Updatable_Help.md). `Update-Help` checks the version of the help installed. If `Update-Help` can't find updated help @@ -162,7 +162,7 @@ Get-Module -ListAvailable | Where-Object -Property HelpInfoUri ``` ```output - Directory: C:\program files\powershell\6\Modules + Directory: C:\Program Files\PowerShell\6\Modules ModuleType Version Name PSEdition ExportedCommands ---------- ------- ---- --------- ---------------- @@ -192,9 +192,9 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 -Param( - [parameter(Mandatory=$false)] - [String[]] +param ( + [Parameter(Mandatory=$false)] + [string[]] $Module ) $HelpInfoNamespace = @{helpInfo='http://schemas.microsoft.com/powershell/help/2010/05'} @@ -216,7 +216,7 @@ foreach ($mModule in $Modules) $mCulture=$mNode.Node.UICultureName $mVer=$mNode.Node.UICultureVersion - [PSCustomObject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} + [pscustomobject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} } } } @@ -367,7 +367,7 @@ are permitted. You can pipeline modules from the `Get-Module` cmdlet to the `Upd The modules that you specify must be installed on the computer, but they don't have to be imported into the current session. You can specify any module in the session or any module that's installed -in a location listed in the `$env:PSModulePath` environment variable. +in a location listed in the `$Env:PSModulePath` environment variable. A value of `*` (all) attempts to update help for all modules that are installed on the computer. Modules that don't support Updatable Help are included. This value might generate errors when the @@ -375,7 +375,7 @@ command encounters modules that don't support Updatable Help. Instead, run `Upda parameters. The **Module** parameter of the `Update-Help` cmdlet doesn't accept the full path of a module file -or module manifest file. To update help for a module that isn't in a `$env:PSModulePath` location, +or module manifest file. To update help for a module that isn't in a `$Env:PSModulePath` location, import the module into the current session before you run the `Update-Help` command. ```yaml @@ -598,7 +598,7 @@ for HTTP and port 443 for HTTPS. `Update-Help` supports all modules and the core PowerShell snap-ins. It doesn't support any other snap-ins. -To update help for a module in a location that isn't listed in the `$env:PSModulePath` environment +To update help for a module in a location that isn't listed in the `$Env:PSModulePath` environment variable, import the module into the current session and then run an `Update-Help` command. Run `Update-Help` without parameters or use the **Module** parameter to specify the module name. The **Module** parameter of the `Update-Help` and `Save-Help` cmdlets doesn't accept the full path of a diff --git a/reference/7.5/Microsoft.PowerShell.Core/Wait-Job.md b/reference/7.5/Microsoft.PowerShell.Core/Wait-Job.md index 5b3b1c8b4a6b..6be177891169 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Wait-Job.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Wait-Job.md @@ -145,9 +145,9 @@ The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c` variable. -The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the -local computer. The **Using** scope modifier is introduced in Windows PowerShell 3.0. For more -information about the **Using** scope modifier, see +The command uses the `Using:` scope modifier to indicate that the `$c` variable was defined on the +local computer. The `Using:` scope modifier is introduced in Windows PowerShell 3.0. For more +information about the `Using:` scope modifier, see [about_Remote_Variables](About/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the @@ -185,7 +185,7 @@ The `$done` variable contains a job object that represents the job that ran on S ### Example 5: Wait until one of several jobs finishes ```powershell -Wait-Job -id 1, 2, 5 -Any +Wait-Job -Id 1, 2, 5 -Any ``` This command identifies three jobs by their IDs and waits until any one of them are in a terminating @@ -223,7 +223,7 @@ These commands start a job that gets the Windows PowerShell script files that we in the last week. The first command uses `Start-Job` to start a job on the local computer. The job runs a -`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were +`Get-ChildItem` command that gets all of the files that have a `.ps1` file name extension that were added or updated in the last week. The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job @@ -266,7 +266,7 @@ Get-Job ```Output Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- -1 Job1 Completed True localhost,Server01.. get-service +1 Job1 Completed True localhost,Server01.. Get-Service 4 Job4 Completed True localhost dir | where ``` diff --git a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md index 684161e582a8..ba65a734b356 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Core/Where-Object.md @@ -309,20 +309,20 @@ These commands list processes that have a working set greater than 250 megabytes filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.WorkingSet -GT 250MB } +Get-Process | Where-Object { $_.WorkingSet -gt 250MB } Get-Process | Where-Object WorkingSet -GT 250MB ``` ### Example 3: Get processes based on process name These commands get the processes that have a **ProcessName** property value that begins with the -letter `p`. The **Match** operator lets you use regular expression matches. +letter `p`. The `-match` operator and **Match** parameter let you use regular expression matches. The commands filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.ProcessName -Match "^p.*" } +Get-Process | Where-Object { $_.ProcessName -match "^p.*" } Get-Process | Where-Object ProcessName -Match "^p.*" ``` @@ -812,7 +812,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value matches any of the specified values. For example: -`Get-Process | Where-Object -Property ProcessName -in -Value "Svchost", "TaskHost", "WsmProvHost"` +`Get-Process | Where-Object -Property ProcessName -In -Value "Svchost", "TaskHost", "WsmProvHost"` If the input is a single object, PowerShell converts it to a collection of one object. @@ -864,7 +864,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET type. Enclose the type name in square brackets. -For example, `Get-Process | Where-Object StartTime -Is [DateTime]` +For example, `Get-Process | Where-Object StartTime -Is [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -885,7 +885,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value isn't an instance of the specified .NET type. -For example, `Get-Process | where StartTime -IsNot [DateTime]` +For example, `Get-Process | where StartTime -IsNot [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -1099,7 +1099,7 @@ Indicates that this cmdlet gets objects when the property value doesn't match th expression. When the input is a single object, the matched value is saved in the `$Matches` automatic variable. -For example: `Get-Process | Where-Object ProcessName -NotMatch "PowerShell"` +For example: `Get-Process | Where-Object ProcessName -NotMatch "powershell"` This parameter was introduced in Windows PowerShell 3.0. @@ -1188,7 +1188,7 @@ PowerShell includes the following aliases for `Where-Object`: Starting in Windows PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections. -You can read more about these methods here [about_arrays](About/about_Arrays.md) +You can read more about these methods here [about_Arrays](About/about_Arrays.md) ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md index 51ee282b6365..fc8729a86226 100644 --- a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -198,10 +198,10 @@ $DiskReads | Get-Counter -ComputerName Server01, Server02 -MaxSamples 10 ```Output Timestamp CounterSamples --------- -------------- -6/21/2019 10:51:04 \\Server01\logicaldisk(c:)\disk reads/sec : +6/21/2019 10:51:04 \\Server01\logicaldisk(C:)\disk reads/sec : 0 - \\Server02\logicaldisk(c:)\disk reads/sec : + \\Server02\logicaldisk(C:)\disk reads/sec : 0.983050344269146 ``` diff --git a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md index cf8d9f6aa6e8..5aef0e80c4d8 100644 --- a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md @@ -233,16 +233,16 @@ is a property of the object with a non-null value. ### Example 5: Get event logs from multiple servers This example gets objects that represent the **Application** event logs on three computers: -Server01, Server02, and Server03. The **ForEach** keyword is used because the **ComputerName** +Server01, Server02, and Server03. The `foreach` keyword is used because the **ComputerName** parameter accepts only one value. For more information, see [about_Foreach](../Microsoft.PowerShell.Core/About/about_Foreach.md). ```powershell $S = 'Server01', 'Server02', 'Server03' -ForEach ($Server in $S) { +foreach ($Server in $S) { Get-WinEvent -ListLog Application -ComputerName $Server | Select-Object LogMode, MaximumSizeInBytes, RecordCount, LogName, - @{name='ComputerName'; expression={$Server}} | + @{Name='ComputerName'; Expression={$Server}} | Format-Table -AutoSize } ``` @@ -256,7 +256,7 @@ Circular 15532032 5309 Application Server03 ``` The variable `$S` stores the names three servers: **Server01**, **Server02**, and **Server03**. The -**ForEach** statement uses a loop to process each server, `($Server in $S)`. The script block in the +`foreach` statement uses a loop to process each server, `($Server in $S)`. The script block in the curly braces (`{ }`) runs the `Get-WinEvent` command. The **ListLog** parameter specifies the **Application** log. The **ComputerName** parameter uses the variable `$Server` to get log information from each server. @@ -696,7 +696,7 @@ Hash table queries have the following rules: - The **Path** value takes paths to `.etl`, `.evt`, and `.evtx` log files. - The **LogName**, **Path**, and **ProviderName** keys can be used in the same query. - The **UserID** key can take a valid security identifier (SID) or a domain account name that can be - used to construct a valid **System.Security.Principal.NTAccount object**. + used to construct a valid **System.Security.Principal.NTAccount** object. - The **Data** value takes event data in an unnamed field. For example, events in classic event logs. - `` key represents a named event data field. @@ -784,7 +784,7 @@ Accept wildcard characters: False ### -Force Gets debug and analytic logs, in addition to other event logs. The **Force** parameter is required -to get a debug or analytic log when the value of the name parameter includes wildcard characters. +to get a debug or analytic log when the value of the Name parameter includes wildcard characters. By default, the `Get-WinEvent` cmdlet excludes these logs unless you specify the full name of a debug or analytic log. diff --git a/reference/7.5/Microsoft.PowerShell.Diagnostics/New-WinEvent.md b/reference/7.5/Microsoft.PowerShell.Diagnostics/New-WinEvent.md index a15b4ee3b8e3..67de24eae5a0 100644 --- a/reference/7.5/Microsoft.PowerShell.Diagnostics/New-WinEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Diagnostics/New-WinEvent.md @@ -47,7 +47,7 @@ In version 0, the **IsMachine** field is a boolean value. In version 1, the **Is an unsigned integer value. ```powershell -(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -eq 8007 +(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -EQ 8007 ``` ```Output @@ -96,9 +96,9 @@ to the **PolicyElaspedTimeInSeconds** field. This example shows how to create an event using a specific template version. ```powershell -$Payload = @(300, [uint32]'0x8001011f', $env:USERNAME, 0, 1) +$Payload = @(300, [uint32]'0x8001011f', $Env:USERNAME, 0, 1) New-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -Id 8007 -Version 1 -Payload $Payload -Get-winEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 +Get-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 ``` ```Output diff --git a/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md index 0ebbdcda9ff1..4b895baac7b3 100644 --- a/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md @@ -86,13 +86,13 @@ running PowerShell, the version of PowerShell, and the date and time. The transc the `\\Server01\Transcripts` file share. ```powershell -$sharepath = '\\Server01\Transcripts' -$username = $env:USERNAME +$sharePath = '\\Server01\Transcripts' +$username = $Env:USERNAME $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() -$datetime = Get-Date -f 'yyyyMMddHHmmss' +$datetime = Get-Date -F 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = (Join-Path -Path $sharepath -ChildPath $filename).ToString() +$Transcript = (Join-Path -Path $sharePath -ChildPath $filename).ToString() Start-Transcript ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Clear-Content.md b/reference/7.5/Microsoft.PowerShell.Management/Clear-Content.md index f274f0e37d25..32f786778069 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Clear-Content.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Clear-Content.md @@ -333,7 +333,7 @@ manipulate content. To clear items that are not considered to be content, such a the PowerShell Certificate or Registry providers, use `Clear-Item`. The `Clear-Content` cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. +To list the providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md index c23cab9eb445..e1d48cc263e8 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md @@ -275,7 +275,7 @@ PowerShell includes the following aliases for `Clear-Item`: - The `Clear-Item` cmdlet is supported only by several PowerShell providers, including the **Alias**, **Environment**, **Function**, **Registry**, and **Variable** providers. As such, you can use `Clear-Item` to delete the content of items in the provider namespaces. To list the - providers available in your session, type `Get-PsProvider`. For more information, see + providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). - You cannot use `Clear-Item` to delete the contents of a file, because the PowerShell FileSystem provider does not support this cmdlet. To clear files, use the `Clear-Content`. diff --git a/reference/7.5/Microsoft.PowerShell.Management/Debug-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Debug-Process.md index b10d78b6e489..0386177ca06e 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Debug-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Debug-Process.md @@ -47,7 +47,7 @@ verify that a debugger is installed and configured. ### Example 1: Attach a debugger to a process on the computer ```powershell -Debug-Process -Name Powershell +Debug-Process -Name powershell ``` This command attaches a debugger to the PowerShell process on the computer. @@ -80,14 +80,14 @@ This command attaches a debugger to the processes that have process IDs 1132 and ### Example 5: Use Get-Process to get a process then attach a debugger to it ```powershell -Get-Process PowerShell | Debug-Process +Get-Process powershell | Debug-Process ``` This command attaches a debugger to the PowerShell processes on the computer. It uses the `Get-Process` cmdlet to get the PowerShell processes on the computer, and it uses a pipeline operator (`|`) to send the processes to the `Debug-Process` cmdlet. -To specify a particular PowerShell process, use the ID parameter of `Get-Process`. +To specify a particular PowerShell process, use the **Id** parameter of `Get-Process`. ### Example 6: Attach a debugger to a current process on the local computer @@ -107,7 +107,7 @@ For more information about the `$PID` automatic variable, see ### Example 7: Attach a debugger to a process that uses the InputObject parameter ```powershell -$P = Get-Process PowerShell +$P = Get-Process powershell Debug-Process -InputObject $P ``` @@ -237,7 +237,7 @@ This cmdlet returns no output. ## NOTES This cmdlet uses the AttachDebugger method of the Windows Management Instrumentation (WMI) -Win32_Process class. For more information about this method, see +**Win32_Process** class. For more information about this method, see [AttachDebugger method](https://go.microsoft.com/fwlink/?LinkId=143640) in Microsoft Learn. ## RELATED LINKS diff --git a/reference/7.6/Microsoft.PowerShell.Core/Update-Help.md b/reference/7.6/Microsoft.PowerShell.Core/Update-Help.md index 764b2ee31272..8ec2e46517f4 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Update-Help.md @@ -44,7 +44,7 @@ for a module or if your help files are outdated, `Update-Help` downloads the new help files can be downloaded and installed from the internet or a file share. Without parameters, `Update-Help` updates the help files for modules that support updateable help -and are loaded in the session or installed in a location included in the `$env:PSModulePath`. For +and are loaded in the session or installed in a location included in the `$Env:PSModulePath`. For more information, see [about_Updatable_Help](./About/about_Updatable_Help.md). `Update-Help` checks the version of the help installed. If `Update-Help` can't find updated help @@ -162,7 +162,7 @@ Get-Module -ListAvailable | Where-Object -Property HelpInfoUri ``` ```output - Directory: C:\program files\powershell\6\Modules + Directory: C:\Program Files\PowerShell\6\Modules ModuleType Version Name PSEdition ExportedCommands ---------- ------- ---- --------- ---------------- @@ -192,9 +192,9 @@ The script uses the **PSCustomObject** class and a hash table to create a custom ```powershell # Get-UpdateHelpVersion.ps1 -Param( - [parameter(Mandatory=$false)] - [String[]] +param ( + [Parameter(Mandatory=$false)] + [string[]] $Module ) $HelpInfoNamespace = @{helpInfo='http://schemas.microsoft.com/powershell/help/2010/05'} @@ -216,7 +216,7 @@ foreach ($mModule in $Modules) $mCulture=$mNode.Node.UICultureName $mVer=$mNode.Node.UICultureVersion - [PSCustomObject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} + [pscustomobject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} } } } @@ -367,7 +367,7 @@ are permitted. You can pipeline modules from the `Get-Module` cmdlet to the `Upd The modules that you specify must be installed on the computer, but they don't have to be imported into the current session. You can specify any module in the session or any module that's installed -in a location listed in the `$env:PSModulePath` environment variable. +in a location listed in the `$Env:PSModulePath` environment variable. A value of `*` (all) attempts to update help for all modules that are installed on the computer. Modules that don't support Updatable Help are included. This value might generate errors when the @@ -375,7 +375,7 @@ command encounters modules that don't support Updatable Help. Instead, run `Upda parameters. The **Module** parameter of the `Update-Help` cmdlet doesn't accept the full path of a module file -or module manifest file. To update help for a module that isn't in a `$env:PSModulePath` location, +or module manifest file. To update help for a module that isn't in a `$Env:PSModulePath` location, import the module into the current session before you run the `Update-Help` command. ```yaml @@ -598,7 +598,7 @@ for HTTP and port 443 for HTTPS. `Update-Help` supports all modules and the core PowerShell snap-ins. It doesn't support any other snap-ins. -To update help for a module in a location that isn't listed in the `$env:PSModulePath` environment +To update help for a module in a location that isn't listed in the `$Env:PSModulePath` environment variable, import the module into the current session and then run an `Update-Help` command. Run `Update-Help` without parameters or use the **Module** parameter to specify the module name. The **Module** parameter of the `Update-Help` and `Save-Help` cmdlets doesn't accept the full path of a diff --git a/reference/7.6/Microsoft.PowerShell.Core/Wait-Job.md b/reference/7.6/Microsoft.PowerShell.Core/Wait-Job.md index 58391b49381b..2d0608d9374d 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Wait-Job.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Wait-Job.md @@ -144,9 +144,9 @@ The third command uses `Invoke-Command` cmdlet to run `Start-Job` in each of the The `Start-Job` command starts a job that runs the `Get-EventLog` command in the `$c` variable. -The command uses the **Using** scope modifier to indicate that the `$c` variable was defined on the -local computer. The **Using** scope modifier is introduced in Windows PowerShell 3.0. For more -information about the **Using** scope modifier, see +The command uses the `Using:` scope modifier to indicate that the `$c` variable was defined on the +local computer. The `Using:` scope modifier is introduced in Windows PowerShell 3.0. For more +information about the `Using:` scope modifier, see [about_Remote_Variables](./about/about_Remote_Variables.md). The fourth command uses `Invoke-Command` to run a `Wait-Job` command in the sessions. It uses the @@ -184,7 +184,7 @@ The `$done` variable contains a job object that represents the job that ran on S ### Example 5: Wait until one of several jobs finishes ```powershell -Wait-Job -id 1,2,5 -Any +Wait-Job -Id 1,2,5 -Any ``` This command identifies three jobs by their IDs and waits until any one of them are in a terminating @@ -222,7 +222,7 @@ These commands start a job that gets the Windows PowerShell script files that we in the last week. The first command uses `Start-Job` to start a job on the local computer. The job runs a -`Get-ChildItem` command that gets all of the files that have a .ps1 file name extension that were +`Get-ChildItem` command that gets all of the files that have a `.ps1` file name extension that were added or updated in the last week. The third command uses `Wait-Job` to wait until the job is in a terminating state. When the job @@ -265,7 +265,7 @@ Get-Job ```Output Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- -1 Job1 Completed True localhost,Server01.. get-service +1 Job1 Completed True localhost,Server01.. Get-Service 4 Job4 Completed True localhost dir | where ``` diff --git a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md index 8b22dcfebaab..eabe5396f217 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Core/Where-Object.md @@ -309,20 +309,20 @@ These commands list processes that have a working set greater than 250 megabytes filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.WorkingSet -GT 250MB } +Get-Process | Where-Object { $_.WorkingSet -gt 250MB } Get-Process | Where-Object WorkingSet -GT 250MB ``` ### Example 3: Get processes based on process name These commands get the processes that have a **ProcessName** property value that begins with the -letter `p`. The **Match** operator lets you use regular expression matches. +letter `p`. The `-match` operator and **Match** parameter let you use regular expression matches. The commands filter the processes the same way and return the same output. Only the syntax is different. ```powershell -Get-Process | Where-Object { $_.ProcessName -Match "^p.*" } +Get-Process | Where-Object { $_.ProcessName -match "^p.*" } Get-Process | Where-Object ProcessName -Match "^p.*" ``` @@ -812,7 +812,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value matches any of the specified values. For example: -`Get-Process | Where-Object -Property ProcessName -in -Value "Svchost", "TaskHost", "WsmProvHost"` +`Get-Process | Where-Object -Property ProcessName -In -Value "Svchost", "TaskHost", "WsmProvHost"` If the input is a single object, PowerShell converts it to a collection of one object. @@ -864,7 +864,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET type. Enclose the type name in square brackets. -For example, `Get-Process | Where-Object StartTime -Is [DateTime]` +For example, `Get-Process | Where-Object StartTime -Is [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -885,7 +885,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value isn't an instance of the specified .NET type. -For example, `Get-Process | where StartTime -IsNot [DateTime]` +For example, `Get-Process | where StartTime -IsNot [datetime]` This parameter was introduced in Windows PowerShell 3.0. @@ -1099,7 +1099,7 @@ Indicates that this cmdlet gets objects when the property value doesn't match th expression. When the input is a single object, the matched value is saved in the `$Matches` automatic variable. -For example: `Get-Process | Where-Object ProcessName -NotMatch "PowerShell"` +For example: `Get-Process | Where-Object ProcessName -NotMatch "powershell"` This parameter was introduced in Windows PowerShell 3.0. @@ -1188,7 +1188,7 @@ PowerShell includes the following aliases for `Where-Object`: Starting in Windows PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections. -You can read more about these methods here [about_arrays](./About/about_Arrays.md) +You can read more about these methods here [about_Arrays](./About/about_Arrays.md) ## RELATED LINKS diff --git a/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-Counter.md index c8338512c37b..137c77f22786 100644 --- a/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -196,10 +196,10 @@ $DiskReads | Get-Counter -ComputerName Server01, Server02 -MaxSamples 10 ```Output Timestamp CounterSamples --------- -------------- -6/21/2019 10:51:04 \\Server01\logicaldisk(c:)\disk reads/sec : +6/21/2019 10:51:04 \\Server01\logicaldisk(C:)\disk reads/sec : 0 - \\Server02\logicaldisk(c:)\disk reads/sec : + \\Server02\logicaldisk(C:)\disk reads/sec : 0.983050344269146 ``` diff --git a/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md b/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md index 935166f3f676..9ef87c95fd4a 100644 --- a/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md @@ -232,15 +232,15 @@ is a property of the object with a non-null value. ### Example 5: Get event logs from multiple servers This example gets objects that represent the **Application** event logs on three computers: -Server01, Server02, and Server03. The **ForEach** keyword is used because the **ComputerName** +Server01, Server02, and Server03. The `foreach` keyword is used because the **ComputerName** parameter accepts only one value. For more information, see [about_Foreach](../Microsoft.PowerShell.Core/about/about_Foreach.md). ```powershell $S = 'Server01', 'Server02', 'Server03' -ForEach ($Server in $S) { +foreach ($Server in $S) { Get-WinEvent -ListLog Application -ComputerName $Server | Select-Object LogMode, MaximumSizeInBytes, RecordCount, LogName, - @{name='ComputerName'; expression={$Server}} | + @{Name='ComputerName'; Expression={$Server}} | Format-Table -AutoSize } ``` @@ -254,7 +254,7 @@ Circular 15532032 5309 Application Server03 ``` The variable `$S` stores the names three servers: **Server01**, **Server02**, and **Server03**. The -**ForEach** statement uses a loop to process each server, `($Server in $S)`. The script block in the +`foreach` statement uses a loop to process each server, `($Server in $S)`. The script block in the curly braces (`{ }`) runs the `Get-WinEvent` command. The **ListLog** parameter specifies the **Application** log. The **ComputerName** parameter uses the variable `$Server` to get log information from each server. @@ -692,7 +692,7 @@ Hash table queries have the following rules: - The **Path** value takes paths to `.etl`, `.evt`, and `.evtx` log files. - The **LogName**, **Path**, and **ProviderName** keys can be used in the same query. - The **UserID** key can take a valid security identifier (SID) or a domain account name that can be - used to construct a valid **System.Security.Principal.NTAccount object**. + used to construct a valid **System.Security.Principal.NTAccount** object. - The **Data** value takes event data in an unnamed field. For example, events in classic event logs. - `` key represents a named event data field. @@ -778,7 +778,7 @@ Accept wildcard characters: False ### -Force Gets debug and analytic logs, in addition to other event logs. The **Force** parameter is required -to get a debug or analytic log when the value of the name parameter includes wildcard characters. +to get a debug or analytic log when the value of the Name parameter includes wildcard characters. By default, the `Get-WinEvent` cmdlet excludes these logs unless you specify the full name of a debug or analytic log. diff --git a/reference/7.6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md b/reference/7.6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md index cdb3337c412a..a521500863a1 100644 --- a/reference/7.6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md @@ -47,7 +47,7 @@ In version 0, the **IsMachine** field is a boolean value. In version 1, the **Is an unsigned integer value. ```powershell -(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -eq 8007 +(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Where-Object Id -EQ 8007 ``` ```Output @@ -96,9 +96,9 @@ to the **PolicyElaspedTimeInSeconds** field. This example shows how to create an event using a specific template version. ```powershell -$Payload = @(300, [uint32]'0x8001011f', $env:USERNAME, 0, 1) +$Payload = @(300, [uint32]'0x8001011f', $Env:USERNAME, 0, 1) New-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -Id 8007 -Version 1 -Payload $Payload -Get-winEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 +Get-WinEvent -ProviderName Microsoft-Windows-GroupPolicy -MaxEvents 1 ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md index 784a6d1aa5d1..1993d7825d06 100644 --- a/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md @@ -86,13 +86,13 @@ running PowerShell, the version of PowerShell, and the date and time. The transc the `\\Server01\Transcripts` file share. ```powershell -$sharepath = '\\Server01\Transcripts' -$username = $env:USERNAME +$sharePath = '\\Server01\Transcripts' +$username = $Env:USERNAME $hostname = hostname $version = $PSVersionTable.PSVersion.ToString() -$datetime = Get-Date -f 'yyyyMMddHHmmss' +$datetime = Get-Date -F 'yyyyMMddHHmmss' $filename = "Transcript-${username}-${hostname}-${version}-${datetime}.txt" -$Transcript = Join-Path -Path $sharepath -ChildPath $filename +$Transcript = Join-Path -Path $sharePath -ChildPath $filename Start-Transcript ``` diff --git a/reference/7.6/Microsoft.PowerShell.Management/Clear-Content.md b/reference/7.6/Microsoft.PowerShell.Management/Clear-Content.md index a387d2277074..3ba9e05b5e66 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Clear-Content.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Clear-Content.md @@ -333,7 +333,7 @@ manipulate content. To clear items that are not considered to be content, such a the PowerShell Certificate or Registry providers, use `Clear-Item`. The `Clear-Content` cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. +To list the providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.6/Microsoft.PowerShell.Management/Clear-Item.md b/reference/7.6/Microsoft.PowerShell.Management/Clear-Item.md index 3da261711f2d..ef52136a03d1 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Clear-Item.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Clear-Item.md @@ -274,7 +274,7 @@ PowerShell includes the following aliases for `Clear-Item`: - The `Clear-Item` cmdlet is supported only by several PowerShell providers, including the **Alias**, **Environment**, **Function**, **Registry**, and **Variable** providers. As such, you can use `Clear-Item` to delete the content of items in the provider namespaces. To list the - providers available in your session, type `Get-PsProvider`. For more information, see + providers available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). - You cannot use `Clear-Item` to delete the contents of a file, because the PowerShell FileSystem provider does not support this cmdlet. To clear files, use the `Clear-Content`. diff --git a/reference/7.6/Microsoft.PowerShell.Management/Debug-Process.md b/reference/7.6/Microsoft.PowerShell.Management/Debug-Process.md index c7aeddf73d96..54be725ac94e 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Debug-Process.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Debug-Process.md @@ -47,7 +47,7 @@ verify that a debugger is installed and configured. ### Example 1: Attach a debugger to a process on the computer ```powershell -Debug-Process -Name Powershell +Debug-Process -Name powershell ``` This command attaches a debugger to the PowerShell process on the computer. @@ -80,14 +80,14 @@ This command attaches a debugger to the processes that have process IDs 1132 and ### Example 5: Use Get-Process to get a process then attach a debugger to it ```powershell -Get-Process PowerShell | Debug-Process +Get-Process powershell | Debug-Process ``` This command attaches a debugger to the PowerShell processes on the computer. It uses the `Get-Process` cmdlet to get the PowerShell processes on the computer, and it uses a pipeline operator (`|`) to send the processes to the `Debug-Process` cmdlet. -To specify a particular PowerShell process, use the ID parameter of `Get-Process`. +To specify a particular PowerShell process, use the **Id** parameter of `Get-Process`. ### Example 6: Attach a debugger to a current process on the local computer @@ -107,7 +107,7 @@ For more information about the `$PID` automatic variable, see ### Example 7: Attach a debugger to a process that uses the InputObject parameter ```powershell -$P = Get-Process PowerShell +$P = Get-Process powershell Debug-Process -InputObject $P ``` @@ -237,7 +237,7 @@ This cmdlet returns no output. ## NOTES This cmdlet uses the AttachDebugger method of the Windows Management Instrumentation (WMI) -Win32_Process class. For more information about this method, see +**Win32_Process** class. For more information about this method, see [AttachDebugger method](https://go.microsoft.com/fwlink/?LinkId=143640) in the MSDN library. ## RELATED LINKS