Mark -NoTypeInformation as obsolete no-op and evaluate -IncludeTypeInformation on by value on Csv cmdlets (#26719)

This commit is contained in:
Yoshifumi
2026-01-28 17:06:15 -05:00
committed by GitHub
parent b3a38645af
commit 8489f8fc34
4 changed files with 6 additions and 29 deletions
@@ -101,11 +101,6 @@ Describe "ConvertTo-Csv" -Tags "CI" {
Should -Throw -ErrorId "CannotSpecifyQuoteFieldsAndUseQuotes,Microsoft.PowerShell.Commands.ConvertToCsvCommand"
}
It "Does not support -IncludeTypeInformation and -NoTypeInformation at the same time" {
{ $testObject | ConvertTo-Csv -IncludeTypeInformation -NoTypeInformation } |
Should -Throw -ErrorId "CannotSpecifyIncludeTypeInformationAndNoTypeInformation,Microsoft.PowerShell.Commands.ConvertToCsvCommand"
}
Context "QuoteFields parameter" {
It "QuoteFields" {
# Use 'FiRstCoLumn' to test case insensitivity
@@ -91,11 +91,6 @@ Describe "Export-Csv" -Tags "CI" {
$results[0] | Should -BeExactly "#TYPE System.String"
}
It "Does not support -IncludeTypeInformation and -NoTypeInformation at the same time" {
{ $testObject | Export-Csv -Path $testCsv -IncludeTypeInformation -NoTypeInformation } |
Should -Throw -ErrorId "CannotSpecifyIncludeTypeInformationAndNoTypeInformation,Microsoft.PowerShell.Commands.ExportCsvCommand"
}
It "Should support -LiteralPath parameter" {
$testObject | Export-Csv -LiteralPath $testCsv
$results = Import-Csv -Path $testCsv