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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The tracing cmdlets were designed for PowerShell developers, but they are availa
### Example 1: Get trace sources by name

```powershell
Get-TraceSource -Name "*provider*"
Get-TraceSource -Name "*Provider*"
```

This command gets all of the trace sources that have names that include provider.
Expand Down
6 changes: 3 additions & 3 deletions reference/5.1/Microsoft.PowerShell.Utility/Get-Unique.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ These commands find the number of unique words in a text file.

```powershell
$A = $( foreach ($line in Get-Content C:\Test1\File1.txt) {
$line.tolower().split(" ")
$line.ToLower().Split(" ")
}) | Sort-Object | Get-Unique
$A.count
$A.Count
```

The first command gets the content of the `File.txt` file. It converts each line of text to
Expand Down Expand Up @@ -97,7 +97,7 @@ directs `Get-Unique` to return only one object of each type.
This command gets the names of processes running on the computer with duplicates eliminated.

```powershell
Get-Process | Sort-Object | Select-Object processname | Get-Unique -AsString
Get-Process | Sort-Object | Select-Object ProcessName | Get-Unique -AsString
```

The `Get-Process` command gets all of the processes on the computer. The pipeline operator (`|`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Windows PowerShell includes the following aliases for `Get-Variable`:
- `gv`

- This cmdlet does not manage environment variables. To manage environment variables, you can use
the environment variable provider.
the Environment provider.

## RELATED LINKS

Expand Down
4 changes: 2 additions & 2 deletions reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This example uses the **NoElement** parameter to omit the members of the group.
```powershell
$files = Get-ChildItem -Path $PSHOME -Recurse
$files |
Group-Object -Property extension -NoElement |
Group-Object -Property Extension -NoElement |
Sort-Object -Property Count -Descending
```

Expand Down Expand Up @@ -180,7 +180,7 @@ values are **CmdletInfo** object. The **AsString** parameter doesn't convert the
groups to strings.

```powershell
$A = Get-Command Get-*, Set-* -CommandType cmdlet |
$A = Get-Command Get-*, Set-* -CommandType Cmdlet |
Group-Object -Property Verb -AsHashTable -AsString
$A
```
Expand Down
2 changes: 1 addition & 1 deletion reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ delimiter, or direct `Import-Csv` to use the list separator for the current cult
delimiter.

You can also use the `ConvertTo-Csv` and `ConvertFrom-Csv` cmdlets to convert objects to CSV
strings (and back). These cmdlets are the same as the `Export-CSV` and `Import-Csv` cmdlets, except
strings (and back). These cmdlets are the same as the `Export-Csv` and `Import-Csv` cmdlets, except
that they work with data from the pipeline instead of from files.

If a header row entry in a CSV file contains an empty or null value, PowerShell inserts a default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ file in the `C:\test\zh-CN` directory into the `$Messages` variable.
### Example 2: Import localized data strings

This example is run at the command line not in a script. It gets localized data strings from the
Test.psd1 file and displays them at the command line. Because the command isn't used in a script,
`Test.psd1` file and displays them at the command line. Because the command isn't used in a script,
the **FileName** parameter is required. The command uses the **UICulture** parameter to specify the
en-US culture.

Expand Down Expand Up @@ -154,12 +154,12 @@ Import-LocalizedData -BindingVariable "UserMessages"
$UserMessages.Msg1...
```

In this example, the DATA section of the TestScript.ps1 script contains a `ConvertFrom-StringData`
In this example, the DATA section of the `TestScript.ps1` script contains a `ConvertFrom-StringData`
command that converts the contents of the DATA section to a hashtable and stores in the value of the
`$UserMessages` variable.

The script also includes an `Import-LocalizedData` command, which imports a hashtable of translated
text strings from the TestScript.psd1 file in the subdirectory specified by the value of the
text strings from the `TestScript.psd1` file in the subdirectory specified by the value of the
`$PSUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from
the file in the value of the same `$UserMessages` variable, overwriting the hashtable saved by the
DATA section logic.
Expand Down Expand Up @@ -256,7 +256,7 @@ Accept wildcard characters: False

### -FileName

Specifies the name of the data file (`.psd1)` to be imported. Enter a filename. You can specify a
Specifies the name of the data file (`.psd1`) to be imported. Enter a filename. You can specify a
filename that doesn't include its `.psd1` filename extension, or you can specify the filename
including the `.psd1` filename extension. Data files should be saved as Unicode or UTF-8.

Expand Down
14 changes: 7 additions & 7 deletions reference/5.1/Microsoft.PowerShell.Utility/Import-PSSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ need to use the `Invoke-Command` cmdlet to run an imported command.
```
$S1 = New-PSSession -ComputerName s1
$S2 = New-PSSession -ComputerName s2
Import-PSSession -Session s1 -Type cmdlet -Name New-Test, Get-Test -FormatTypeName *
Import-PSSession -Session s1 -Type Cmdlet -Name New-Test, Get-Test -FormatTypeName *
Import-PSSession -Session s2 -Type Cmdlet -Name Set-Test -FormatTypeName *
New-Test Test1 | Set-Test -RunType Full
```
Expand Down Expand Up @@ -199,7 +199,7 @@ function into the current session.

The `Import-PSSession` cmdlet returns a **PSModuleInfo** object that represents the temporary
module. The value of the **Path** property shows that `Import-PSSession` created a script module
(.psm1) file in a temporary location. The **ExportedFunctions** property shows that the `Get-Date`
(`.psm1`) file in a temporary location. The **ExportedFunctions** property shows that the `Get-Date`
cmdlet and the SearchHelp function were both imported as functions.

### Example 7: Run a command that is hidden by an imported command
Expand Down Expand Up @@ -327,7 +327,7 @@ Accept wildcard characters: False
Specifies an array of commands that results from using the specified arguments (parameter values).

For instance, to import the variant of the `Get-Item` command in the certificate (Cert:) drive in
the PSSession in `$S`, type `Import-PSSession -Session $S -Command Get-Item -ArgumentList cert:`.
the PSSession in `$S`, type `Import-PSSession -Session $S -Command Get-Item -ArgumentList Cert:`.

```yaml
Type: System.Object[]
Expand All @@ -344,7 +344,7 @@ Accept wildcard characters: False
### -Certificate

Specifies the client certificate that is used to sign the format files (*.Format.ps1xml) or script
module files (.psm1) in the temporary module that `Import-PSSession` creates.
module files (`.psm1`) in the temporary module that `Import-PSSession` creates.

Enter a variable that contains a certificate or a command or expression that gets the certificate.

Expand Down Expand Up @@ -398,11 +398,11 @@ alias, **Type**. The acceptable values for this parameter are:
- `Alias`: The Windows PowerShell aliases in the remote session.
- `All`: The cmdlets and functions in the remote session.
- `Application`: All the files other than Windows-PowerShell files in the paths that are listed in
the Path environment variable (`$env:path`) in the remote session, including .txt, .exe, and .dll
the PATH environment variable (`$Env:PATH`) in the remote session, including .txt, .exe, and .dll
files.
- `Cmdlet`: The cmdlets in the remote session. "Cmdlet" is the default.
- `ExternalScript`: The .ps1 files in the paths listed in the Path environment variable
(`$env:path`) in the remote session.
- `ExternalScript`: The `.ps1` files in the paths listed in the PATH environment variable
(`$Env:PATH`) in the remote session.
- `Filter` and `Function`: The Windows PowerShell functions in the remote session.
- `Script`: The script blocks in the remote session.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: Import-PowerShellDataFile
# Import-PowerShellDataFile

## SYNOPSIS
Imports values from a `.PSD1` file without invoking its contents.
Imports values from a `.psd1` file without invoking its contents.

## SYNTAX

Expand All @@ -30,7 +30,7 @@ Import-PowerShellDataFile [-LiteralPath <string[]>] [<CommonParameters>]
## DESCRIPTION

The `Import-PowerShellDataFile` cmdlet safely imports key-value pairs from hashtables defined in a
`.PSD1` file. The values could be imported using `Invoke-Expression` on the contents of the file.
`.psd1` file. The values could be imported using `Invoke-Expression` on the contents of the file.
However, `Invoke-Expression` runs any code contained in the file. This could produce unwanted
results or execute unsafe code. `Import-PowerShellDataFile` imports the data without invoking the
code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ Invoke-Expression -Command "C:\ps-test\testscript.ps1"
"C:\ps-test\testscript.ps1" | Invoke-Expression
```

These commands use `Invoke-Expression` to run a script, TestScript.ps1, on the local computer. The
These commands use `Invoke-Expression` to run a script, `TestScript.ps1`, on the local computer. The
two commands are equivalent. The first uses the **Command** parameter to specify the command to run.
The second uses a pipeline operator (`|`) to send the command string to `Invoke-Expression`.

### Example 3: Run a command in a variable

```powershell
$Command = 'Get-Process | where {$_.cpu -gt 1000}'
$Command = 'Get-Process | where {$_.CPU -gt 1000}'
Invoke-Expression $Command
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The `Invoke-RestMethod` cmdlet sends HTTP and HTTPS requests to Representational

PowerShell formats the response based to the data type. For an RSS or ATOM feed, PowerShell returns
the Item or Entry XML nodes. For JavaScript Object Notation (JSON) or XML, PowerShell converts, or
deserializes, the content into `[PSCustomObject]` objects. Comments aren't permitted in the JSON
deserializes, the content into `[pscustomobject]` objects. Comments aren't permitted in the JSON
data.

> [!NOTE]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The tracing cmdlets were designed for PowerShell developers, but they are availa
### Example 1: Get trace sources by name

```powershell
Get-TraceSource -Name "*provider*"
Get-TraceSource -Name "*Provider*"
```

This command gets all of the trace sources that have names that include provider.
Expand Down
6 changes: 3 additions & 3 deletions reference/7.4/Microsoft.PowerShell.Utility/Get-Unique.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ These commands find the number of unique words in a text file.

```powershell
$A = $( foreach ($line in Get-Content C:\Test1\File1.txt) {
$line.tolower().split(" ")
$line.ToLower().Split(" ")
}) | Sort-Object | Get-Unique
$A.count
$A.Count
```

The first command gets the content of the `File.txt` file. It converts each line of text to
Expand Down Expand Up @@ -97,7 +97,7 @@ directs `Get-Unique` to return only one object of each type.
This command gets the names of processes running on the computer with duplicates eliminated.

```powershell
Get-Process | Sort-Object | Select-Object processname | Get-Unique -AsString
Get-Process | Sort-Object | Select-Object ProcessName | Get-Unique -AsString
```

The `Get-Process` command gets all of the processes on the computer. The pipeline operator (`|`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ PowerShell includes the following aliases for `Get-Variable`:
- `gv`

- This cmdlet does not manage environment variables. To manage environment variables, you can use
the environment variable provider.
the Environment provider.

## RELATED LINKS

Expand Down
4 changes: 2 additions & 2 deletions reference/7.4/Microsoft.PowerShell.Utility/Group-Object.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This example uses the **NoElement** parameter to omit the members of the group.
```powershell
$files = Get-ChildItem -Path $PSHOME -Recurse
$files |
Group-Object -Property extension -NoElement |
Group-Object -Property Extension -NoElement |
Sort-Object -Property Count -Descending
```

Expand Down Expand Up @@ -208,7 +208,7 @@ values are **CmdletInfo** object. The **AsString** parameter doesn't convert the
groups to strings.

```powershell
$A = Get-Command Get-*, Set-* -CommandType cmdlet |
$A = Get-Command Get-*, Set-* -CommandType Cmdlet |
Group-Object -Property Verb -AsHashTable -AsString
$A
```
Expand Down
2 changes: 1 addition & 1 deletion reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ delimiter, or direct `Import-Csv` to use the list separator for the current cult
delimiter.

You can also use the `ConvertTo-Csv` and `ConvertFrom-Csv` cmdlets to convert objects to CSV
strings (and back). These cmdlets are the same as the `Export-CSV` and `Import-Csv` cmdlets, except
strings (and back). These cmdlets are the same as the `Export-Csv` and `Import-Csv` cmdlets, except
that they work with data from the pipeline instead of from files.

If a header row entry in a CSV file contains an empty or null value, PowerShell inserts a default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ file in the `C:\test\zh-CN` directory into the `$Messages` variable.
### Example 2: Import localized data strings

This example is run at the command line not in a script. It gets localized data strings from the
Test.psd1 file and displays them at the command line. Because the command isn't used in a script,
`Test.psd1` file and displays them at the command line. Because the command isn't used in a script,
the **FileName** parameter is required. The command uses the **UICulture** parameter to specify the
en-US culture.

Expand Down Expand Up @@ -154,12 +154,12 @@ Import-LocalizedData -BindingVariable "UserMessages"
$UserMessages.Msg1...
```

In this example, the DATA section of the TestScript.ps1 script contains a `ConvertFrom-StringData`
In this example, the DATA section of the `TestScript.ps1` script contains a `ConvertFrom-StringData`
command that converts the contents of the DATA section to a hashtable and stores in the value of the
`$UserMessages` variable.

The script also includes an `Import-LocalizedData` command, which imports a hashtable of translated
text strings from the TestScript.psd1 file in the subdirectory specified by the value of the
text strings from the `TestScript.psd1` file in the subdirectory specified by the value of the
`$PSUICulture` variable. If the command finds the `.psd1` file, it saves the translated strings from
the file in the value of the same `$UserMessages` variable, overwriting the hashtable saved by the
DATA section logic.
Expand Down Expand Up @@ -256,7 +256,7 @@ Accept wildcard characters: False

### -FileName

Specifies the name of the data file (`.psd1)` to be imported. Enter a filename. You can specify a
Specifies the name of the data file (`.psd1`) to be imported. Enter a filename. You can specify a
filename that doesn't include its `.psd1` filename extension, or you can specify the filename
including the `.psd1` filename extension. Data files should be saved as Unicode or UTF-8.

Expand Down
14 changes: 7 additions & 7 deletions reference/7.4/Microsoft.PowerShell.Utility/Import-PSSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ need to use the `Invoke-Command` cmdlet to run an imported command.
```
$S1 = New-PSSession -ComputerName s1
$S2 = New-PSSession -ComputerName s2
Import-PSSession -Session s1 -Type cmdlet -Name New-Test, Get-Test -FormatTypeName *
Import-PSSession -Session s1 -Type Cmdlet -Name New-Test, Get-Test -FormatTypeName *
Import-PSSession -Session s2 -Type Cmdlet -Name Set-Test -FormatTypeName *
New-Test Test1 | Set-Test -RunType Full
```
Expand Down Expand Up @@ -199,7 +199,7 @@ function into the current session.

The `Import-PSSession` cmdlet returns a **PSModuleInfo** object that represents the temporary
module. The value of the **Path** property shows that `Import-PSSession` created a script module
(.psm1) file in a temporary location. The **ExportedFunctions** property shows that the `Get-Date`
(`.psm1`) file in a temporary location. The **ExportedFunctions** property shows that the `Get-Date`
cmdlet and the SearchHelp function were both imported as functions.

### Example 7: Run a command that is hidden by an imported command
Expand Down Expand Up @@ -327,7 +327,7 @@ Accept wildcard characters: False
Specifies an array of commands that results from using the specified arguments (parameter values).

For instance, to import the variant of the `Get-Item` command in the certificate (Cert:) drive in
the PSSession in `$S`, type `Import-PSSession -Session $S -Command Get-Item -ArgumentList cert:`.
the PSSession in `$S`, type `Import-PSSession -Session $S -Command Get-Item -ArgumentList Cert:`.

```yaml
Type: System.Object[]
Expand All @@ -344,7 +344,7 @@ Accept wildcard characters: False
### -Certificate

Specifies the client certificate that is used to sign the format files (*.Format.ps1xml) or script
module files (.psm1) in the temporary module that `Import-PSSession` creates.
module files (`.psm1`) in the temporary module that `Import-PSSession` creates.

Enter a variable that contains a certificate or a command or expression that gets the certificate.

Expand Down Expand Up @@ -398,11 +398,11 @@ alias, **Type**. The acceptable values for this parameter are:
- `Alias`: The Windows PowerShell aliases in the remote session.
- `All`: The cmdlets and functions in the remote session.
- `Application`: All the files other than Windows-PowerShell files in the paths that are listed in
the Path environment variable (`$env:path`) in the remote session, including .txt, .exe, and .dll
the PATH environment variable (`$Env:PATH`) in the remote session, including .txt, .exe, and .dll
files.
- `Cmdlet`: The cmdlets in the remote session. "Cmdlet" is the default.
- `ExternalScript`: The .ps1 files in the paths listed in the Path environment variable
(`$env:path`) in the remote session.
- `ExternalScript`: The `.ps1` files in the paths listed in the PATH environment variable
(`$Env:PATH`) in the remote session.
- `Filter` and `Function`: The Windows PowerShell functions in the remote session.
- `Script`: The script blocks in the remote session.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: Import-PowerShellDataFile
# Import-PowerShellDataFile

## SYNOPSIS
Imports values from a `.PSD1` file without invoking its contents.
Imports values from a `.psd1` file without invoking its contents.

## SYNTAX

Expand All @@ -30,7 +30,7 @@ Import-PowerShellDataFile [-LiteralPath] <String[]> [-SkipLimitCheck] [<CommonPa
## DESCRIPTION

The `Import-PowerShellDataFile` cmdlet safely imports key-value pairs from hashtables defined in a
`.PSD1` file. The values could be imported using `Invoke-Expression` on the contents of the file.
`.psd1` file. The values could be imported using `Invoke-Expression` on the contents of the file.
However, `Invoke-Expression` runs any code contained in the file. This could produce unwanted
results or execute unsafe code. `Import-PowerShellDataFile` imports the data without invoking the
code. By default there is a 500 key limit, but this can be bypassed with the **SkipLimitCheck**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ Invoke-Expression -Command "C:\ps-test\testscript.ps1"
"C:\ps-test\testscript.ps1" | Invoke-Expression
```

These commands use `Invoke-Expression` to run a script, TestScript.ps1, on the local computer. The
These commands use `Invoke-Expression` to run a script, `TestScript.ps1`, on the local computer. The
two commands are equivalent. The first uses the **Command** parameter to specify the command to run.
The second uses a pipeline operator (`|`) to send the command string to `Invoke-Expression`.

### Example 3: Run a command in a variable

```powershell
$Command = 'Get-Process | where {$_.cpu -gt 1000}'
$Command = 'Get-Process | where {$_.CPU -gt 1000}'
Invoke-Expression $Command
```

Expand Down
Loading