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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions reference/5.1/Microsoft.PowerShell.Core/Update-Help.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
---------- ------- ---- --------- ----------------
Expand Down Expand Up @@ -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'}
Expand All @@ -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}
}
}
}
Expand Down Expand Up @@ -419,15 +419,15 @@ 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
command encounters modules that don't support Updatable Help. Instead, run `Update-Help` without
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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions reference/5.1/Microsoft.PowerShell.Core/Wait-Job.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand Down
18 changes: 9 additions & 9 deletions reference/5.1/Microsoft.PowerShell.Core/Where-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
```

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
14 changes: 7 additions & 7 deletions reference/5.1/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand All @@ -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.
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
10 changes: 5 additions & 5 deletions reference/5.1/Microsoft.PowerShell.Management/Debug-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand Down
Loading