or download this
my ($cols, $lines) = split ' ', (grep { m{^\s*\d+\s+\d+\s}xms } `p
+owershell -command "&{\$H=get-host;\$H.ui.rawui.WindowSize;}"`)[0];
$ENV{'COLUMNS'} = $cols;
$ENV{'LINES'} = $lines;
print "COLUMNS and LINES are set ($cols,$lines).\n";