'String data to array using Powershell
Using Posh-SSH module to read a csv file directly from a sftp server,
$Content = Get-SFTPContent -SFTPSession $Session -Path "/test.csv" -ContentType String
-ContentType MultiLine errors out with "Get-SFTPContent : Failed to get content to file /test.csv"
Once read $Content is a one large single page with type System.String.
Is there a way to store the data to an array / hashtable to be used in the next steps of the script? do not want to export to a file, want to do the conversation in the memory (will need to delete the file straight after Get-SFTPContent is complete)
csv file in the folder is simple, get-aduser -properties * | select Name,Enabled,mobile,SamAccountName ... | Export-Csv c:\temp\test.csv -NoTypeInformation
Appreciate some assistance ...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
