diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 20df4fd57db..440cd3aaa96 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -176,12 +177,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 5b07a9678a9..943f69636df 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -109,7 +110,10 @@ information header from the CSV output. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md index 2b566898a32..29cdca82065 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -142,11 +143,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 @@ -176,10 +178,15 @@ 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 ``` @@ -218,7 +225,8 @@ 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 ``` @@ -229,7 +237,8 @@ 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 ``` @@ -245,10 +254,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 @@ -372,8 +381,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md index 0866ffe354f..55dfdfaf5ac 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -271,8 +272,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -292,12 +293,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 6980ee05592..7032af9335c 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -177,12 +178,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 24b44cf2fe5..08c91d2de45 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -186,7 +187,10 @@ only the key is converted to CSV. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md index b62fbaea6ce..d102d002f31 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/15/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -144,11 +145,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 @@ -179,10 +181,15 @@ 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 ``` @@ -221,7 +228,8 @@ 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 ``` @@ -232,7 +240,8 @@ 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 ``` @@ -248,10 +257,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 @@ -456,8 +465,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md index a65d9de0016..451f034bf86 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -284,8 +285,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -305,12 +306,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index ad1d86c5b7d..82bab5b3cbb 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -177,12 +178,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 461b9497ef6..6680c935b61 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -188,7 +189,10 @@ only the key is converted to CSV. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md index 0e5f58fddab..9482644e2f3 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/15/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -460,8 +461,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md index 3af35608f0f..5d2e0f19cae 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -284,8 +285,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -305,12 +306,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index b8e0ee37771..fcb9eee839b 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 11/18/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertfrom-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertFrom-Csv @@ -10,6 +10,7 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS + Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -145,7 +146,7 @@ the **InputObject** parameter and converts the CSV strings from the `$Services` When the **UseCulture** parameter is used, be sure that the current culture's default list separator matches the delimiter used in the CSV strings. Otherwise, `ConvertFrom-Csv` can't -generate objects from the CSV strings. +can't parse each column into distinct properties. ### Example 5: Convert CSV data in W3C Extended Log Format @@ -177,12 +178,17 @@ time cs-method cs-uri ### -Delimiter -Specifies the delimiter that separates the property values in the CSV strings. The default is a -comma (`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in -single quotation marks. +Specifies the delimiter that separates the property values in the CSV data. The default is a comma +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. -If you specify a character other than the actual string delimiter in the file, `ConvertFrom-Csv` -can't create the objects from the CSV strings and returns the CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `ConvertFrom-Csv` +can't parse each column into distinct properties. In this case, it outputs one **PSCustomObject** +per row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 268917fbef9..4521d66a274 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/14/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/convertto-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: ConvertTo-Csv @@ -11,6 +11,7 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS + Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -186,7 +187,10 @@ only the key is converted to CSV. ### -Delimiter Specifies the delimiter to separate the property values in CSV strings. The default is a comma -(`,`). Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +(`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. ```yaml diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md index e0efa06265a..f6aed2d3ddf 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 03/15/2023 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -179,10 +180,15 @@ 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 ``` @@ -221,7 +227,8 @@ 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 ``` @@ -232,7 +239,8 @@ 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 ``` @@ -456,8 +464,11 @@ Accept wildcard characters: False ### -Delimiter -Specifies a delimiter to separate the property values. The default is a comma (`,`). Enter a -character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in quotation marks. +Specifies a delimiter to separate the property values. The default is a comma (`,`). + +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single +quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double +quotation marks. ```yaml Type: System.Char diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md index 2fa2ddfa044..794c152f7b4 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 01/09/2025 +ms.date: 12/27/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -13,6 +13,7 @@ title: Import-Csv # Import-Csv ## SYNOPSIS + Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -284,8 +285,8 @@ Import-Csv -Path .\Projects.csv ``` ```Output -WARNING: One or more headers weren't specified. Default names starting with "H" have been used in -place of any missing headers. +WARNING: One or more headers weren't specified. Default names starting with "H" have been +used in place of any missing headers. ProjectID ProjectName H1 Completed --------- ----------- -- --------- @@ -305,12 +306,14 @@ displays a warning message because **H1** is a default header name. Specifies the delimiter that separates the property values in the CSV file. The default is a comma (`,`). -Enter a character, such as a colon (`:`). To specify a semicolon (`;`) enclose it in single +Enter a character, such as a colon (`:`). To specify a semicolon (`;`), enclose it in single quotation marks. To specify escaped special characters such as tab (`` `t ``), enclose it in double quotation marks. -If you specify a character other than the actual string delimiter in the file, `Import-Csv` can't -create the objects from the CSV strings and returns the full CSV strings. +If the specified character doesn't match the actual delimiter in the CSV data, `Import-Csv` can't +parse each column into distinct properties. In this case, it outputs one **PSCustomObject** per +row, each containing a single property whose name is the full header and whose value is the row +text. ```yaml Type: System.Char