79490933

Date: 2025-03-06 23:39:59
Score: 1
Natty:
Report link

Any help?

$csvFilename = 'C:\CSV\FromNickk.csv'
$outfile = 'C:\CSV\Flora.mxtsessions'
$csv = Import-Csv -Path $csvFilename -Delimiter ','

@'
[Bookmarks]
SubRep=
ImgNum=42
'@ | Out-File -FilePath $outfile

$output = foreach ($line in $csv) {
    "$($line.hostname)= #109#0%$($line.ip)%22%[loginuser]%%-1%-1%%%22%%0%0%0%%%-1%0%0%0%%1080%%0%0%1#MobaFont%10%0%0%0%15%236,236,236%0,0,0%180,180,192%0%-1%0%%xterm%-1%0%0,0,0%54,54,54%255,96,96%255,128,128%96,255,96%128,255,128%255,255,54%255,255,128%96,96,255%128,128,255%255,54,255%255,128,255%54,255,255%128,255,255%236,236,236%255,255,255%80%24%0%1%-1%<none>%%0#0#"
}

$output | Out-File -FilePath $outfile -Append -Encoding ASCII

I am using this, but it is importing a blank session and the CSV file has more than that.

I was using this before

$csvFilename = 'C:\Users\ikundabayo.ma\OneDrive - Procter and Gamble\Documents\From Nick.csv'
$outfile = 'C:\Users\ikundabayo.ma\OneDrive - Procter and Gamble\Documents\DYFCMobaXterm_Sessions.mxtsessions'
$csv = Import-Csv -Path $csvFilename -Delimiter ','

$output = foreach ($line in $csv) {
    "$($line.hostname)=#109#0%$($line.ip)%22%[loginuser]%%-1%-1%%%22%%0%0%0%%%-1%0%0%0%%1080%%0%0%1#MobaFont%10%0%0%0%15%236,236,236%0,0,0%180,180,192%0%-1%0%%xterm%-1%0%0,0,0%54,54,54%255,96,96%255,128,128%96,255,96%128,255,128%255,255,54%255,255,128%96,96,255%128,128,255%255,54,255%255,128,255%54,255,255%128,255,255%236,236,236%255,255,255%80%24%0%1%-1%<none>%%0#0#"
}

$output | Out-File -FilePath $outfile -Encoding ASCII
Reasons:
  • Blacklisted phrase (1): Any help
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Ikundabayo Mathusalem