This is how I would do it:
First put the following function into you Powershell profile, this will give you a Get-Clipboard cmdlet which will always be available.
function Get-Clipboard([switch] $Lines) {
if($Lines) {
$cmd = {
Add-Type -Assembly PresentationCore
[Windows.Clipboard]::GetText() -replace "`r", '' -split "`n"
}
} else {
$cmd = {
Add-Type -Assembly PresentationCore
[Windows.Clipboard]::GetText()
}
}
if([threading.thread]::CurrentThread.GetApartmentState() -eq 'MTA') {
& powershell -Sta -Command $cmd
} else {
& $cmd
}
}
Then all you need to is copy your table from Excel (make sure you have a header for each column) then type the following into your Powershell console:
$data = Get-Clipboard | ConvertFrom-Csv -Delimiter "`t"
$data
Import-csvwhich is simpler. Depends on what your end game is.