You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I live in a region where encodings like windows-1252 is used, so it would be really beneficial to enable this in dbatools, in particular import-dbacsv applet. Here is an example of what I am looking to achieve;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Chrissy.
Thank you to You and the team for all Your great work on this module!
Since PS 6.2 it has been acceptable to set encoding using its numeric ID for MS applet in general;
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-7.5
I live in a region where encodings like windows-1252 is used, so it would be really beneficial to enable this in dbatools, in particular import-dbacsv applet. Here is an example of what I am looking to achieve;
#Default; ASCII,BigEndianUnicode,Byte,String,Unicode,UTF7,UTF8,Unknown
[string]$Encoding = '1252'
$CodePageInfo = [System.Text.Encoding]::GetEncodings() |
Where-Object{$_.CodePage -eq $Encoding -or
$_.CodePage -eq ([System.Text.Encoding]::$Encoding).CodePage}
$EncodingObj = [System.Text.Encoding]::GetEncoding($CodePageInfo.CodePage)
$EncodingObj
I have testet this in PS 5.1 so I am fairly confident it has backwards compatibility.
Thanks for Your consideration.
Br Thomas
Beta Was this translation helpful? Give feedback.
All reactions