Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown and PS Styles #11785

Merged
merged 4 commits into from
Feb 11, 2025
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/7.5/Microsoft.PowerShell.Utility/Export-Alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Exports information about currently defined aliases to a file.
### ByPath (Default)

```
Export-Alias [-Path] <String> [[-Name] <String[]>] [-PassThru] [-As <ExportAliasFormat>] [-Append]
[-Force] [-NoClobber] [-Description <String>] [-Scope <String>] [-WhatIf] [-Confirm]
[<CommonParameters>]
Export-Alias [-Path] <String> [[-Name] <String[]>] [-PassThru] [-As <ExportAliasFormat>]
[-Append] [-Force] [-NoClobber] [-Description <String>] [-Scope <String>] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

### ByLiteralPath

```
Export-Alias -LiteralPath <String> [[-Name] <String[]>] [-PassThru] [-As <ExportAliasFormat>]
[-Append] [-Force] [-NoClobber] [-Description <String>] [-Scope <String>] [-WhatIf] [-Confirm]
[<CommonParameters>]
Export-Alias -LiteralPath <String> [[-Name] <String[]>] [-PassThru]
[-As <ExportAliasFormat>] [-Append] [-Force] [-NoClobber] [-Description <String>]
[-Scope <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -45,15 +45,15 @@ profile.
### Example 1: Export an alias

```powershell
Export-Alias -Path "alias.csv"
Export-Alias -Path "Alias.csv"
```

This command exports current alias information to a file named Alias.csv in the current directory.

### Example 2: Export an alias unless the export file already exists

```powershell
Export-Alias -Path "alias.csv" -NoClobber
Export-Alias -Path "Alias.csv" -NoClobber
```

This command exports the aliases in the current session to an Alias.csv file.
Expand All @@ -64,7 +64,7 @@ exists in the current directory.
### Example 3: Append aliases to a file

```powershell
Export-Alias -Path "alias.csv" -Append -Description "Appended Aliases" -Force
Export-Alias -Path "Alias.csv" -Append -Description "Appended Aliases" -Force
```

This command appends the aliases in the current session to the Alias.csv file.
Expand Down
14 changes: 7 additions & 7 deletions reference/7.5/Microsoft.PowerShell.Utility/Export-Clixml.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ Creates an XML-based representation of an object or objects and stores it in a f
### ByPath (Default)

```
Export-Clixml [-Depth <Int32>] [-Path] <String> -InputObject <PSObject> [-Force] [-NoClobber]
[-Encoding <Encoding>] [-WhatIf] [-Confirm] [<CommonParameters>]
Export-Clixml [-Depth <Int32>] [-Path] <String> -InputObject <PSObject> [-Force]
[-NoClobber] [-Encoding <Encoding>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ByLiteralPath

```
Export-Clixml [-Depth <Int32>] -LiteralPath <String> -InputObject <PSObject> [-Force] [-NoClobber]
[-Encoding <Encoding>] [-WhatIf] [-Confirm] [<CommonParameters>]
Export-Clixml [-Depth <Int32>] -LiteralPath <String> -InputObject <PSObject> [-Force]
[-NoClobber] [-Encoding <Encoding>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION

The `Export-Clixml` cmdlet serialized an object into a Common Language Infrastructure (CLI)
XML-based representation stores it in a file. You can then use the `Import-Clixml` cmdlet to
The `Export-Clixml` cmdlet serializes an object into a Common Language Infrastructure (CLI)
XML-based representation and stores it in a file. You can then use the `Import-Clixml` cmdlet to
recreate the saved object based on the contents of that file. For more information about CLI, see
[Language independence](/dotnet/standard/language-independence).

Expand Down Expand Up @@ -192,7 +192,7 @@ The acceptable values for this parameter are as follows:
Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code
pages (like `-Encoding 1251`) or string names of registered code pages (like
`-Encoding "windows-1251"`). For more information, see the .NET documentation for
[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2).
[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A).

Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass
the numeric ID for the current culture's ANSI code page without having to specify it manually.
Expand Down
56 changes: 30 additions & 26 deletions reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ file.
### Delimiter (Default)

```
Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force] [-NoClobber]
[-Encoding <Encoding>] [-Append] [[-Delimiter] <Char>] [-IncludeTypeInformation]
[-NoTypeInformation] [-QuoteFields <String[]>] [-UseQuotes <QuoteKind>] [-NoHeader] [-WhatIf]
[-Confirm] [<CommonParameters>]
Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force]
[-NoClobber] [-Encoding <Encoding>] [-Append] [[-Delimiter] <Char>]
[-IncludeTypeInformation] [-NoTypeInformation] [-QuoteFields <String[]>]
[-UseQuotes <QuoteKind>] [-NoHeader] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### UseCulture

```
Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force] [-NoClobber]
[-Encoding <Encoding>] [-Append] [-UseCulture] [-IncludeTypeInformation] [-NoTypeInformation]
[-QuoteFields <String[]>] [-UseQuotes <QuoteKind>] [-NoHeader] [-WhatIf] [-Confirm]
[<CommonParameters>]
Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force]
[-NoClobber] [-Encoding <Encoding>] [-Append] [-UseCulture] [-IncludeTypeInformation]
[-NoTypeInformation] [-QuoteFields <String[]>] [-UseQuotes <QuoteKind>] [-NoHeader]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -53,7 +53,7 @@ file.

```powershell
Get-Process -Name WmiPrvSE |
Select-Object -Property BasePriority,Id,SessionId,WorkingSet |
Select-Object -Property BasePriority, Id, SessionId, WorkingSet |
Export-Csv -Path .\WmiData.csv -NoTypeInformation
Import-Csv -Path .\WmiData.csv
```
Expand Down Expand Up @@ -142,11 +142,12 @@ Get-Content -Path .\Processes.csv
The `Get-Culture` cmdlet uses the nested properties **TextInfo** and **ListSeparator** and displays
the current culture's default list separator. The `Get-Process` cmdlet gets **Process** objects. The
process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts the
process objects to a series of CSV strings. The **Path** parameter specifies that the `Processes.csv`
file is saved in the current directory. The **UseCulture** parameter uses the current culture's
default list separator as the delimiter. The **NoTypeInformation** parameter removes the **#TYPE**
information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet
uses the **Path** parameter to display the file located in the current directory.
process objects to a series of CSV strings. The **Path** parameter specifies that the
`Processes.csv` file is saved in the current directory. The **UseCulture** parameter uses the
current culture's default list separator as the delimiter. The **NoTypeInformation** parameter
removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6.
The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current
directory.

### Example 5: Export processes with type information

Expand Down Expand Up @@ -177,10 +178,13 @@ This example describes how to export objects to a CSV file and use the **Append*
objects to an existing file.

```powershell
$AppService = (Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status)
$AppService = (Get-Service -DisplayName *Application* |
Select-Object -Property DisplayName, Status)
$AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation
Get-Content -Path .\Services.Csv
$WinService = (Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status)

$WinService = (Get-Service -DisplayName *Windows* |
Select-Object -Property DisplayName, Status)
$WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append
Get-Content -Path .\Services.Csv
```
Expand Down Expand Up @@ -219,7 +223,7 @@ unexpected output is received, troubleshoot the pipeline syntax.

```powershell
Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear |
Export-Csv -Path .\DateTime.csv -NoTypeInformation
Export-Csv -Path .\DateTime.csv -NoTypeInformation
Get-Content -Path .\DateTime.csv
```

Expand All @@ -230,7 +234,7 @@ Get-Content -Path .\DateTime.csv

```powershell
Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear |
Export-Csv -Path .\FTDateTime.csv -NoTypeInformation
Export-Csv -Path .\FTDateTime.csv -NoTypeInformation
Get-Content -Path .\FTDateTime.csv
```

Expand All @@ -246,10 +250,10 @@ Get-Content -Path .\FTDateTime.csv
The `Get-Date` cmdlet gets the **DateTime** object. The object is sent down the pipeline to the
`Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to select a subset of object
properties. The object is sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts
the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved in
the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header
from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path**
parameter to display the CSV file located in the current directory.
the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved
in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information
header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the
**Path** parameter to display the CSV file located in the current directory.

When the `Format-Table` cmdlet is used within the pipeline to select properties unexpected results
are received. `Format-Table` sends table format objects down the pipeline to the `Export-Csv` cmdlet
Expand Down Expand Up @@ -355,7 +359,7 @@ the file located in the current directory.
This example converts a **DateTime** object to a CSV string.

```powershell
Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv
Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv
Get-Content -Path .\FTDateTime.csv
```

Expand All @@ -369,7 +373,7 @@ DateTime,"Thursday, August 22, 2019 11:27:34 AM","8/22/2019 12:00:00 AM",22,Thur
This example converts a **DateTime** object to a CSV string.

```powershell
Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv
Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv
Get-Content -Path .\FTDateTime.csv
```

Expand All @@ -391,7 +395,7 @@ $person1 = @{

$person2 = @{
Name = 'Jane Smith'
Number = 1
Number = 2
}

$allPeople = $person1, $person2
Expand Down Expand Up @@ -490,7 +494,7 @@ The acceptable values for this parameter are as follows:
Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code
pages (like `-Encoding 1251`) or string names of registered code pages (like
`-Encoding "windows-1251"`). For more information, see the .NET documentation for
[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2).
[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A).

Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass
the numeric ID for the current culture's ANSI code page without having to specify it manually.
Expand Down
48 changes: 26 additions & 22 deletions reference/7.5/Microsoft.PowerShell.Utility/Export-FormatData.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,37 @@ Saves formatting data from the current session in a formatting file.
### ByPath (Default)

```
Export-FormatData -InputObject <ExtendedTypeDefinition[]> -Path <String> [-Force] [-NoClobber]
[-IncludeScriptBlock] [<CommonParameters>]
Export-FormatData -InputObject <ExtendedTypeDefinition[]> -Path <String> [-Force]
[-NoClobber] [-IncludeScriptBlock] [<CommonParameters>]
```

### ByLiteralPath

```
Export-FormatData -InputObject <ExtendedTypeDefinition[]> -LiteralPath <String> [-Force] [-NoClobber]
[-IncludeScriptBlock] [<CommonParameters>]
Export-FormatData -InputObject <ExtendedTypeDefinition[]> -LiteralPath <String> [-Force]
[-NoClobber] [-IncludeScriptBlock] [<CommonParameters>]
```

## DESCRIPTION

The `Export-FormatData` cmdlet creates PowerShell formatting files (format.ps1xml) from
the formatting objects in the current session. It takes the **ExtendedTypeDefinition** objects that
The `Export-FormatData` cmdlet creates 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.

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
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 PowerShell, see [about_Format.ps1xml](../Microsoft.PowerShell.Core/About/about_Format.ps1xml.md).
For more information about formatting files in PowerShell, see
[about_Format.ps1xml](../Microsoft.PowerShell.Core/About/about_Format.ps1xml.md).

## EXAMPLES

### 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.
Expand All @@ -55,16 +57,16 @@ The command uses the `Get-FormatData` cmdlet to get the format data in the sessi
(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.

### Example 2: Export format data for a type

```powershell
$F = Get-FormatData -TypeName "helpinfoshort"
Export-FormatData -InputObject $F -Path "c:\test\help.format.ps1xml" -IncludeScriptBlock
$F = Get-FormatData -TypeName "HelpInfoShort"
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.
Expand All @@ -79,8 +81,9 @@ 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 @@ -103,9 +106,9 @@ 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.
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 @@ -205,9 +208,9 @@ 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.
If you omit the path, `Export-FormatData` creates the file in the current directory.
Specifies a location for the output file. 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
recognize the file.
Expand All @@ -232,7 +235,8 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down
Loading
Loading