So I have this powershell script Which import a csv file, replacing null into '0' and export this csv.
The issue is that the content and header of this csv is in hebrew
I tried almost everything Used -Encoding for all types of encoding but nothing
Any Suggestions?
$propertyTranslation = @(
@{ Name = 'Customer__c'; Expression = { $_.'לקוח' } }
@{ Name = 'Name__c'; Expression = { $_.'שם' } }
@{ Name = 'CheckCount__c'; Expression = { $_.'כמות' } }
@{ Name = 'Deal'; Expression = { $_.'עסקהוזה' } }
@{ Name = 'Amount__c'; Expression = { $_.'סכום' } }
@{ Name = 'Discount__c'; Expression = { $_.'ניסיון' } }
# And so on
)
$csv = Import-Csv C:\Users\alon\Documents\again.csv -Header "Customer__c","Name__c","Deal","Amount__c","CheckCount__c","Discount__c"
$csv | ForEach-Object {
if($_.Customer__c -eq "") { $_.Customer__c = "0" }
if($_.Name__c -eq "") { $_.Name__c = "0" }
if($_.Deal -eq "") { $_.Deal = "0" }
if($_.Amount__c -eq "") { $_.Amount__c = "0" }
if($_.Discount__c -eq "") { $_.Discount__c = "0" }
if($_.CheckCount__c -eq "") { $_.CheckCount__c = "0" }
}
Select-Object -Property $propertyTranslation
$csv | Export-Csv C:\Users\alon\Documents\CheckDealBeforeUpsert.csv -NoTypeInformation -Encoding UTF8