I have a file (config.cfg) which has three strings like this: host:user:pass
In my Unix code, I do this to get and assign the value into three different variables:
$FTP_HOST=$( cut -f1 -d: config.cfg )
$FTP_USER=$( cut -f2 -d: config.cfg )
$FTP_PASS=$( cut -f3 -d: config.cfg )
How can I do this in PowerShell 3.0? I have tried with Foreach-Object but couldn't find a way to assign into three variables.