mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
@@ -6,7 +6,7 @@
|
||||
RootModule = 'ImportExcel.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '7.2.1'
|
||||
ModuleVersion = '7.2.2'
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#Requires -Version 5
|
||||
function Read-Clipboard {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
@@ -22,30 +23,24 @@ function Read-Clipboard {
|
||||
$Header
|
||||
)
|
||||
|
||||
if ($IsWindows) {
|
||||
$osInfo = Get-CimInstance -ClassName Win32_OperatingSystem
|
||||
if ($osInfo.ProductType -eq 1) {
|
||||
$cvtParams = @{
|
||||
Data = Get-Clipboard -Raw
|
||||
}
|
||||
|
||||
if ($Delimiter) {
|
||||
$cvtParams.Delimiter = $Delimiter
|
||||
}
|
||||
|
||||
if ($Header) {
|
||||
$cvtParams.Header = $Header
|
||||
}
|
||||
|
||||
ReadClipboardImpl @cvtParams
|
||||
}
|
||||
else {
|
||||
Write-Error "This command is only supported on the desktop."
|
||||
}
|
||||
if ($IsLinux -or $IsMacOS) {
|
||||
Write-Error "Read-Clipboard only runs on Windows"
|
||||
return
|
||||
}
|
||||
else {
|
||||
Write-Error "This function is only available on Windows desktop"
|
||||
|
||||
$cvtParams = @{
|
||||
Data = Get-Clipboard -Raw
|
||||
}
|
||||
|
||||
if ($Delimiter) {
|
||||
$cvtParams.Delimiter = $Delimiter
|
||||
}
|
||||
|
||||
if ($Header) {
|
||||
$cvtParams.Header = $Header
|
||||
}
|
||||
|
||||
ReadClipboardImpl @cvtParams
|
||||
}
|
||||
|
||||
function ReadClipboardImpl {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
# v7.2.2
|
||||
|
||||
- Improved checks for Linux, Mac and PS 5.1
|
||||
|
||||
# v7.2.1
|
||||
|
||||
- Improve auto-detection of data on the clipboard
|
||||
|
||||
# v7.2.0
|
||||
|
||||
- Added `Read-Clipboard` support for Windows. Read text from clipboard. It can read CSV or JSON. Plus, you can specify the delimiter and headers.
|
||||
|
||||
Reference in New Issue
Block a user