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 @@ -107,7 +107,7 @@ Accept wildcard characters: False
### -InputObject
Specifies the object to be converted. Enter a variable that contains the objects, or type a command
or expression that gets the objects. You can also pipe objects to `ConvertTo-XML`.
or expression that gets the objects. You can also pipe objects to `ConvertTo-Xml`.

```yaml
Type: System.Management.Automation.PSObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The acceptable values for this parameter are:
- CSV. Comma-separated value (CSV) format.
- Script. Creates a `Set-Alias` command for each exported alias. If you name the output file with a
.ps1 file name extension, you can run it as a script to add the aliases to any session.
`.ps1` file name extension, you can run it as a script to add the aliases to any session.

```yaml
Type: Microsoft.PowerShell.Commands.ExportAliasFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ recreate the saved object based on the contents of that file. For more informati
[Language independence](/dotnet/standard/language-independence).

This cmdlet is similar to `ConvertTo-Xml`, except that `Export-Clixml` stores the resulting XML in a
file. `ConvertTo-XML` returns the XML, so you can continue to process it in PowerShell.
file. `ConvertTo-Xml` returns the XML, so you can continue to process it in PowerShell.

A valuable use of `Export-Clixml` on Windows computers is to export credentials and secure strings
securely as XML. For an example, see Example 3.
Expand Down
30 changes: 15 additions & 15 deletions reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ Export-Csv [[-Path] <string>] -InputObject <psobject> [-LiteralPath <string>] [-

## DESCRIPTION

The `Export-CSV` cmdlet creates a CSV file of the objects that you submit. Each object is a row that
includes a character-separated list of the object's property values. You can use the `Export-CSV`
The `Export-Csv` cmdlet creates a CSV file of the objects that you submit. Each object is a row that
includes a character-separated list of the object's property values. You can use the `Export-Csv`
cmdlet to create spreadsheets and share data with programs that accept CSV files as input.

Do not format objects before sending them to the `Export-CSV` cmdlet. If `Export-CSV` receives
Do not format objects before sending them to the `Export-Csv` cmdlet. If `Export-Csv` receives
formatted objects the CSV file contains the format properties rather than the object properties. To
export only selected properties of an object, use the `Select-Object` cmdlet.

Expand Down Expand Up @@ -301,9 +301,9 @@ This example shows how to use the **Force** and **Append** parameters. When thes
combined, mismatched object properties can be written to a CSV file.

```powershell
$Content = [PSCustomObject]@{Name = 'PowerShell'; Version = '7.0'}
$Content = [pscustomobject]@{Name = 'PowerShell'; Version = '7.0'}
$Content | Export-Csv -Path .\ParmFile.csv -NoTypeInformation
$AdditionalContent = [PSCustomObject]@{Name = 'Windows PowerShell'; Edition = 'Desktop'}
$AdditionalContent = [pscustomobject]@{Name = 'Windows PowerShell'; Edition = 'Desktop'}
$AdditionalContent | Export-Csv -Path .\ParmFile.csv -NoTypeInformation -Append
```

Expand Down Expand Up @@ -351,8 +351,8 @@ the file located in the current directory.

### -Append

Use this parameter so that `Export-CSV` adds CSV output to the end of the specified file. Without
this parameter, `Export-CSV` replaces the file contents without warning.
Use this parameter so that `Export-Csv` adds CSV output to the end of the specified file. Without
this parameter, `Export-Csv` replaces the file contents without warning.

This parameter was introduced in Windows PowerShell 3.0.

Expand Down Expand Up @@ -436,7 +436,7 @@ Accept wildcard characters: False
### -InputObject

Specifies the objects to export as CSV strings. Enter a variable that contains the objects or type a
command or expression that gets the objects. You can also pipe objects to `Export-CSV`.
command or expression that gets the objects. You can also pipe objects to `Export-Csv`.

```yaml
Type: System.Management.Automation.PSObject
Expand Down Expand Up @@ -471,8 +471,8 @@ Accept wildcard characters: False

### -NoClobber

Use this parameter so that `Export-CSV` does not overwrite an existing file. By default, if the file
exists in the specified path, `Export-CSV` overwrites the file without warning.
Use this parameter so that `Export-Csv` does not overwrite an existing file. By default, if the file
exists in the specified path, `Export-Csv` overwrites the file without warning.

```yaml
Type: System.Management.Automation.SwitchParameter
Expand Down Expand Up @@ -594,13 +594,13 @@ Windows PowerShell includes the following aliases for `Export-Csv`:

- `epcsv`

The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV strings and saves
them in the specified text file. You can use `Export-CSV` to save objects in a CSV file and then use
The `Export-Csv` cmdlet converts the objects that you submit into a series of CSV strings and saves
them in the specified text file. You can use `Export-Csv` to save objects in a CSV file and then use
the `Import-Csv` cmdlet to create objects from the CSV file.

In the CSV file, each object is represented by a character-separated list of the property values of
the object. The property values are converted to strings using the **ToString()** method. The
strings are represented by the property value name. `Export-CSV does not export the methods of the
strings are represented by the property value name. `Export-Csv does not export the methods of the
object.

The CSV strings are output as follows:
Expand All @@ -611,7 +611,7 @@ The CSV strings are output as follows:
contain the first object's property names as a character-separated list.
- The remaining strings contain character-separated lists of each object's property values.

When you submit multiple objects to `Export-CSV`, `Export-CSV` organizes the file based on the
When you submit multiple objects to `Export-Csv`, `Export-Csv` organizes the file based on the
properties of the first object that you submit. If the remaining objects do not have one of the
specified properties, the property value of that object is null, as represented by two consecutive
commas. If the remaining objects have additional properties, those property values are not included
Expand All @@ -622,7 +622,7 @@ resulting objects are CSV versions of the original objects that consist of strin
the property values and no methods.

The `ConvertTo-Csv` and `ConvertFrom-Csv` cmdlets convert objects to CSV strings and from CSV
strings. `Export-CSV` is the same as `ConvertTo-CSV`, except that it saves the CSV strings in a
strings. `Export-Csv` is the same as `ConvertTo-Csv`, except that it saves the CSV strings in a
file.

## RELATED LINKS
Expand Down
37 changes: 19 additions & 18 deletions reference/5.1/Microsoft.PowerShell.Utility/Export-FormatData.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Export-FormatData -InputObject <ExtendedTypeDefinition[]> -LiteralPath <String>

## DESCRIPTION

The `Export-FormatData` cmdlet creates Windows PowerShell formatting files (format.ps1xml) from
The `Export-FormatData` cmdlet creates Windows PowerShell formatting files (`format.ps1xml`) from
the formatting objects in the current session. It takes the **ExtendedTypeDefinition** objects that
`Get-FormatData` returns and saves them in a file in XML format.

Windows PowerShell uses the data in formatting files (format.ps1xml) to generate the default display
of Microsoft .NET Framework objects in the session. You can view and edit the formatting files and
use the Update-FormatData cmdlet to add the formatting data to a session.
Windows PowerShell uses the data in formatting files (`format.ps1xml`) to generate the default
display of Microsoft .NET Framework objects in the session. You can view and edit the formatting
files and use the Update-FormatData cmdlet to add the formatting data to a session.

For more information about formatting files in Windows PowerShell, see [about_Format.ps1xml](../Microsoft.PowerShell.Core/About/about_Format.ps1xml.md).

Expand All @@ -46,16 +46,16 @@ For more information about formatting files in Windows PowerShell, see [about_Fo
### Example 1: Export session format data

```powershell
Get-FormatData -TypeName "*" | Export-FormatData -Path "allformat.ps1xml" -IncludeScriptBlock
Get-FormatData -TypeName "*" | Export-FormatData -Path "AllFormat.ps1xml" -IncludeScriptBlock
```

This command exports all of the format data in the session to the AllFormat.ps1xml file.
This command exports all of the format data in the session to the `AllFormat.ps1xml` file.

The command uses the `Get-FormatData` cmdlet to get the format data in the session. A value of `*`
(all) for the **TypeName** parameter directs the cmdlet to get all of the data in the session.

The command uses a pipeline operator (`|`) to send the format data from the `Get-FormatData` command
to the `Export-FormatData` cmdlet, which exports the format data to the AllFormat.ps1 file.
to the `Export-FormatData` cmdlet, which exports the format data to the `AllFormat.ps1xml` file.

The `Export-FormatData` command uses the **IncludeScriptBlock** parameter to include script blocks
in the format data in the file.
Expand All @@ -64,10 +64,11 @@ in the format data in the file.

```powershell
$F = Get-FormatData -TypeName "helpinfoshort"
Export-FormatData -InputObject $F -Path "c:\test\help.format.ps1xml" -IncludeScriptBlock
Export-FormatData -InputObject $F -Path "C:\test\Help.format.ps1xml" -IncludeScriptBlock
```

These commands export the format data for the **HelpInfoShort** type to the Help.format.ps1xml file.
These commands export the format data for the **HelpInfoShort** type to the `Help.format.ps1xml`
file.

The first command uses the `Get-FormatData` cmdlet to get the format data for the **HelpInfoShort**
type, and it saves it in the `$F` variable.
Expand All @@ -79,8 +80,8 @@ script blocks in the output.
### Example 3: Export format data without a script block

```powershell
Get-FormatData -TypeName "System.Diagnostics.Process" | Export-FormatData -Path process.format.ps1xml
Update-FormatData -PrependPath ".\process.format.ps1xml"
Get-FormatData -TypeName "System.Diagnostics.Process" | Export-FormatData -Path Process.format.ps1xml
Update-FormatData -PrependPath ".\Process.format.ps1xml"
Get-Process p*
```

Expand All @@ -98,14 +99,14 @@ This example shows the effect of omitting the **IncludeScriptBlock** parameter f
The first command uses the `Get-FormatData` cmdlet to get the format data for the
**System.Diagnostics.Process** object that the Get-Process cmdlet returns. The command uses a
pipeline operator (`|`) to send the formatting data to the `Export-FormatData` cmdlet, which exports
it to the Process.format.ps1xml file in the current directory.
it to the `Process.format.ps1xml` file in the current directory.

In this case, the `Export-FormatData` command does not use the **IncludeScriptBlock** parameter.

The second command uses the `Update-FormatData` cmdlet to add the Process.format.ps1xml file to the
current session. The command uses the **PrependPath** parameter to ensure that the formatting data for
process objects in the Process.format.ps1xml file is found before the standard formatting data for
process objects.
The second command uses the `Update-FormatData` cmdlet to add the `Process.format.ps1xml` file to
the current session. The command uses the **PrependPath** parameter to ensure that the formatting
data for process objects in the Process.format.ps1xml file is found before the standard formatting
data for process objects.

The third command shows the effects of this change. The command uses the `Get-Process` cmdlet to
get processes that have names that begin with P. The output shows that property values that are
Expand Down Expand Up @@ -206,10 +207,10 @@ Accept wildcard characters: False
### -Path

Specifies a location for the output file.
Enter a path (optional) and file name with a format.ps1xml file name extension.
Enter a path (optional) and file name with a `format.ps1xml` file name extension.
If you omit the path, `Export-FormatData` creates the file in the current directory.

If you use a file name extension other than .ps1xml, the `Update-FormatData` cmdlet will not
If you use a file name extension other than `.ps1xml`, the `Update-FormatData` cmdlet will not
recognize the file.

If you specify an existing file, `Export-FormatData` overwrites the file without warning, unless
Expand Down
12 changes: 6 additions & 6 deletions reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Exports the variant of the command that results from using the specified argumen
values).
For example, to export the variant of the `Get-Item` command in the certificate (Cert:) drive in
the PSSession in `$S`, type `Export-PSSession -Session $S -Command Get-Item -ArgumentList cert:`.
the PSSession in `$S`, type `Export-PSSession -Session $S -Command Get-Item -ArgumentList Cert:`.

```yaml
Type: System.Object[]
Expand All @@ -200,7 +200,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 module that `Export-PSSession` creates. Enter a variable that contains
module files (`.psm1`) in the module that `Export-PSSession` creates. Enter a variable that contains
a certificate or a command or expression that gets the certificate.

To find a certificate, use the `Get-PfxCertificate` cmdlet or use the `Get-ChildItem` cmdlet in the
Expand Down Expand Up @@ -253,13 +253,13 @@ The acceptable values for this parameter are as follows:

- `Alias`: All PowerShell aliases in the current session.
- `All`: All command types. It is the equivalent of `Get-Command -Name *`.
- `Application`: All files other than PowerShell files in paths listed in the Path environment
variable (`$env:path`), including .txt, .exe, and .dll files.
- `Application`: All files other than PowerShell files in paths listed in the PATH environment
variable (`$Env:PATH`), including .txt, .exe, and .dll files.
- `Cmdlet`: The cmdlets in the current session. Cmdlet is the default.
- `Configuration`: A PowerShell configuration. For more information, see
[about_Session_Configurations](../Microsoft.PowerShell.Core/About/about_Session_Configurations.md).
- `ExternalScript`: All .ps1 files in the paths listed in the Path environment variable
(`$env:path`).
- `ExternalScript`: All `.ps1` files in the paths listed in the PATH environment variable
(`$Env:PATH`).
- `Filter` and `Function`: All PowerShell functions.
- `Script` Script blocks in the current session.
- `Workflow` A PowerShell workflow. For more information, see [about_Workflows](../PSWorkflow/About/about_Workflows.md).
Expand Down
2 changes: 1 addition & 1 deletion reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Specifies the objects to be formatted. Enter a variable that contains the object
or expression that gets the objects.
Only certain [scalar](/powershell/scripting/learn/glossary#scalar-value) types and
`[system.io.fileinfo]` are supported.
`[System.IO.FileInfo]` are supported.

The supported scalar types are:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ If you do not use a format cmdlet, PowerShell applies that default format for ea
displays.

The **View** parameter lets you specify an alternate format for the table. You can use the views
defined in the `*.format.PS1XML` files in the PowerShell directory, or you can create your own views
defined in the `*.format.ps1xml` files in the PowerShell directory, or you can create your own views
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

The alternate view for the **View** parameter must use the list format, otherwise, the command
Expand Down
6 changes: 3 additions & 3 deletions reference/5.1/Microsoft.PowerShell.Utility/Format-Table.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ more information about views and the code used to create this example's view, se
[about_Format.ps1xml](../Microsoft.PowerShell.Core/About/about_Format.ps1xml.md#sample-xml-for-a-format-table-custom-view).

```powershell
Get-ChildItem -Path C:\Test | Format-Table -View mygciview
Get-ChildItem -Path C:\Test | Format-Table -View MyGciView
```

```Output
Expand All @@ -121,7 +121,7 @@ d----- 10/23/2019 09:38 2/25/2019 09:38 Files

`Get-ChildItem` gets the contents of the current directory, `C:\Test`. The
**System.IO.DirectoryInfo** and **System.IO.FileInfo** objects are sent down the pipeline.
`Format-Table` uses the **View** parameter to specify the custom view **mygciview** that includes
`Format-Table` uses the **View** parameter to specify the custom view **MyGciView** that includes
the **CreationTime** column.

The default `Format-Table` output for `Get-ChildItem` doesn't include the **CreationTime** column.
Expand Down Expand Up @@ -177,7 +177,7 @@ local computer. You can use `Get-CimInstance` with the **ComputerName** paramete
from remote computers.

```powershell
$Processes = Get-CimInstance -Class win32_process -Filter "name='notepad.exe'"
$Processes = Get-CimInstance -Class Win32_Process -Filter "name='notepad.exe'"
$Processes | Format-Table ProcessName, @{
Label = "Total Running Time"
Expression={(Get-Date) - $_.CreationDate}
Expand Down
4 changes: 2 additions & 2 deletions reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ output. The **Column** parameter specifies the number of columns.
This command displays the names of registry keys in the `HKEY_CURRENT_USER\Software\Microsoft` key.

```powershell
Get-ChildItem HKCU:\software\microsoft | Format-Wide -Property pschildname -AutoSize
Get-ChildItem HKCU:\software\Microsoft | Format-Wide -Property PSChildName -AutoSize
```

The `Get-ChildItem` cmdlet gets objects representing the keys. The path is specified as `HKCU:`, one
Expand Down Expand Up @@ -309,7 +309,7 @@ Windows PowerShell includes the following aliases for `Format-Wide`:
- `fw`

The **View** parameter lets you specify an alternate format for the table. You can use the views
defined in the `*.format.PS1XML` files in the PowerShell directory or you can create your own views
defined in the `*.format.ps1xml` files in the PowerShell directory or you can create your own views
in new PS1XML files and use the `Update-FormatData` cmdlet to include them in PowerShell.

The alternate view for the **View** parameter must use table format; if it does not, the command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Accept wildcard characters: False
### -InputObject
Specifies the object to be converted. Enter a variable that contains the objects, or type a command
or expression that gets the objects. You can also pipe objects to `ConvertTo-XML`.
or expression that gets the objects. You can also pipe objects to `ConvertTo-Xml`.

```yaml
Type: System.Management.Automation.PSObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The acceptable values for this parameter are:
- CSV. Comma-separated value (CSV) format.
- Script. Creates a `Set-Alias` command for each exported alias. If you name the output file with a
.ps1 file name extension, you can run it as a script to add the aliases to any session.
`.ps1` file name extension, you can run it as a script to add the aliases to any session.

```yaml
Type: Microsoft.PowerShell.Commands.ExportAliasFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ recreate the saved object based on the contents of that file. For more informati
[Language independence](/dotnet/standard/language-independence).

This cmdlet is similar to `ConvertTo-Xml`, except that `Export-Clixml` stores the resulting XML in a
file. `ConvertTo-XML` returns the XML, so you can continue to process it in PowerShell.
file. `ConvertTo-Xml` returns the XML, so you can continue to process it in PowerShell.

A valuable use of `Export-Clixml` on Windows computers is to export credentials and secure strings
securely as XML. For an example, see Example 3.
Expand Down
Loading