Improve auto-detection of data on the clipboard

This commit is contained in:
dfinke
2021-07-24 19:41:57 -04:00
parent 99de9a9854
commit c641eea10a
4 changed files with 7 additions and 58 deletions

View File

@@ -62,7 +62,9 @@ function ReadClipboardImpl {
ConvertFrom-Json $data
}
catch {
if ($data.indexof(",") -gt -1) {
$dataLines = @($data -split "`r`n?" | Select-Object -First 1)
if ($dataLines[0].indexOf(',') -gt -1) {
ConvertFrom-Csv $data
}
else {