Welcome › Forums › General PowerShell Q&A › Help with removing double quotes
- This topic has 1 reply, 2 voices, and was last updated 1 month ago by
Participant.
-
AuthorPosts
-
-
December 14, 2020 at 1:11 pm #279561
Hi,
No matter what i do in SSIS to import this powershell produced csv and put the contents in a table it adds double quotes:
PowerShell1234$MailUser |Select-Object -Property SAMAccountName, GivenName, EmailAddress,@{n="Password-Expires"; e={[System.Math]::Round((New-TimeSpan -Start $CurrentPWChangeDateLimit -End ($MailUser.PasswordLastSet)).TotalDays)}} |Export-Csv $outputFile -Append -NoTypeInformation -Encoding UTF8Tried doing derived columns like: REPLACE([“SAMAccountName”],”\””,””) but still not working
Is there anyway of outputting the above, just with commas and not the double quotes?
-
December 14, 2020 at 1:30 pm #279567
This is more of SSIS question. Typically, a double qoute would be specified as the Text Qualifier:
http://www.msbiguide.com/text-qualifier-property-in-ssis/
If you have SQL Management Studio installed, there is SQL modules available to take $MailUser and inject it into SQL with Write-SQLTable or Invoke-SQLCmd:
https://docs.microsoft.com/en-us/powershell/module/sqlserver/?view=sqlserver-ps
or using many other various methods if you do not want a pre-requisite of SQL Mgmt:
-
-
AuthorPosts
- You must be logged in to reply to this topic.