@@ -19,19 +19,19 @@ file.
1919### Delimiter (Default)
2020
2121```
22- Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force] [-NoClobber]
23- [-Encoding <Encoding>] [-Append] [[-Delimiter] <Char>] [-IncludeTypeInformation ]
24- [-NoTypeInformation ] [-QuoteFields <String[]>] [-UseQuotes <QuoteKind>] [-NoHeader] [-WhatIf ]
25- [-Confirm] [<CommonParameters>]
22+ Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force]
23+ [-NoClobber] [- Encoding <Encoding>] [-Append] [[-Delimiter] <Char>]
24+ [-IncludeTypeInformation ] [-NoTypeInformation] [-QuoteFields <String[]> ]
25+ [-UseQuotes <QuoteKind>] [-NoHeader] [-WhatIf] [- Confirm] [<CommonParameters>]
2626```
2727
2828### UseCulture
2929
3030```
31- Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force] [-NoClobber]
32- [-Encoding <Encoding>] [-Append] [-UseCulture] [-IncludeTypeInformation] [-NoTypeInformation ]
33- [-QuoteFields <String[]>] [-UseQuotes <QuoteKind>] [-NoHeader] [-WhatIf] [-Confirm ]
34- [<CommonParameters>]
31+ Export-Csv -InputObject <PSObject> [[-Path] <String>] [-LiteralPath <String>] [-Force]
32+ [-NoClobber] [- Encoding <Encoding>] [-Append] [-UseCulture] [-IncludeTypeInformation]
33+ [-NoTypeInformation] [- QuoteFields <String[]>] [-UseQuotes <QuoteKind>] [-NoHeader]
34+ [-WhatIf] [-Confirm] [ <CommonParameters>]
3535```
3636
3737## DESCRIPTION
5353
5454``` powershell
5555Get-Process -Name WmiPrvSE |
56- Select-Object -Property BasePriority,Id,SessionId,WorkingSet |
56+ Select-Object -Property BasePriority, Id, SessionId, WorkingSet |
5757 Export-Csv -Path .\WmiData.csv -NoTypeInformation
5858Import-Csv -Path .\WmiData.csv
5959```
@@ -142,11 +142,12 @@ Get-Content -Path .\Processes.csv
142142The ` Get-Culture ` cmdlet uses the nested properties ** TextInfo** and ** ListSeparator** and displays
143143the current culture's default list separator. The ` Get-Process ` cmdlet gets ** Process** objects. The
144144process objects are sent down the pipeline to the ` Export-Csv ` cmdlet. ` Export-Csv ` converts the
145- process objects to a series of CSV strings. The ** Path** parameter specifies that the ` Processes.csv `
146- file is saved in the current directory. The ** UseCulture** parameter uses the current culture's
147- default list separator as the delimiter. The ** NoTypeInformation** parameter removes the ** #TYPE**
148- information header from the CSV output and is not required in PowerShell 6. The ` Get-Content ` cmdlet
149- uses the ** Path** parameter to display the file located in the current directory.
145+ process objects to a series of CSV strings. The ** Path** parameter specifies that the
146+ ` Processes.csv ` file is saved in the current directory. The ** UseCulture** parameter uses the
147+ current culture's default list separator as the delimiter. The ** NoTypeInformation** parameter
148+ removes the ** #TYPE** information header from the CSV output and is not required in PowerShell 6.
149+ The ` Get-Content ` cmdlet uses the ** Path** parameter to display the file located in the current
150+ directory.
150151
151152### Example 5: Export processes with type information
152153
@@ -177,10 +178,13 @@ This example describes how to export objects to a CSV file and use the **Append*
177178objects to an existing file.
178179
179180``` powershell
180- $AppService = (Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status)
181+ $AppService = (Get-Service -DisplayName *Application* |
182+ Select-Object -Property DisplayName, Status)
181183$AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation
182184Get-Content -Path .\Services.Csv
183- $WinService = (Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status)
185+
186+ $WinService = (Get-Service -DisplayName *Windows* |
187+ Select-Object -Property DisplayName, Status)
184188$WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append
185189Get-Content -Path .\Services.Csv
186190```
@@ -219,7 +223,7 @@ unexpected output is received, troubleshoot the pipeline syntax.
219223
220224``` powershell
221225Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear |
222- Export-Csv -Path .\DateTime.csv -NoTypeInformation
226+ Export-Csv -Path .\DateTime.csv -NoTypeInformation
223227Get-Content -Path .\DateTime.csv
224228```
225229
@@ -230,7 +234,7 @@ Get-Content -Path .\DateTime.csv
230234
231235``` powershell
232236Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear |
233- Export-Csv -Path .\FTDateTime.csv -NoTypeInformation
237+ Export-Csv -Path .\FTDateTime.csv -NoTypeInformation
234238Get-Content -Path .\FTDateTime.csv
235239```
236240
@@ -246,10 +250,10 @@ Get-Content -Path .\FTDateTime.csv
246250The ` Get-Date ` cmdlet gets the ** DateTime** object. The object is sent down the pipeline to the
247251` Select-Object ` cmdlet. ` Select-Object ` uses the ** Property** parameter to select a subset of object
248252properties. The object is sent down the pipeline to the ` Export-Csv ` cmdlet. ` Export-Csv ` converts
249- the object to a CSV format. The ** Path** parameter specifies that the ` DateTime.csv ` file is saved in
250- the current directory. The ** NoTypeInformation** parameter removes the ** #TYPE** information header
251- from the CSV output and is not required in PowerShell 6. The ` Get-Content ` cmdlet uses the ** Path **
252- parameter to display the CSV file located in the current directory.
253+ the object to a CSV format. The ** Path** parameter specifies that the ` DateTime.csv ` file is saved
254+ in the current directory. The ** NoTypeInformation** parameter removes the ** #TYPE** information
255+ header from the CSV output and is not required in PowerShell 6. The ` Get-Content ` cmdlet uses the
256+ ** Path ** parameter to display the CSV file located in the current directory.
253257
254258When the ` Format-Table ` cmdlet is used within the pipeline to select properties unexpected results
255259are received. ` Format-Table ` sends table format objects down the pipeline to the ` Export-Csv ` cmdlet
@@ -355,7 +359,7 @@ the file located in the current directory.
355359This example converts a ** DateTime** object to a CSV string.
356360
357361``` powershell
358- Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv
362+ Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv
359363Get-Content -Path .\FTDateTime.csv
360364```
361365
@@ -369,7 +373,7 @@ DateTime,"Thursday, August 22, 2019 11:27:34 AM","8/22/2019 12:00:00 AM",22,Thur
369373This example converts a ** DateTime** object to a CSV string.
370374
371375``` powershell
372- Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv
376+ Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv
373377Get-Content -Path .\FTDateTime.csv
374378```
375379
@@ -391,7 +395,7 @@ $person1 = @{
391395
392396$person2 = @{
393397 Name = 'Jane Smith'
394- Number = 1
398+ Number = 2
395399}
396400
397401$allPeople = $person1, $person2
@@ -490,7 +494,7 @@ The acceptable values for this parameter are as follows:
490494Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code
491495pages (like `-Encoding 1251`) or string names of registered code pages (like
492496` -Encoding "windows-1251"` ). For more information, see the .NET documentation for
493- [Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2 ).
497+ [Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A ).
494498
495499Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass
496500the numeric ID for the current culture's ANSI code page without having to specify it manually.
0 commit comments