mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
@@ -6,7 +6,7 @@
|
|||||||
RootModule = 'ImportExcel.psm1'
|
RootModule = 'ImportExcel.psm1'
|
||||||
|
|
||||||
# Version number of this module.
|
# Version number of this module.
|
||||||
ModuleVersion = '7.2.1'
|
ModuleVersion = '7.2.2'
|
||||||
|
|
||||||
# ID used to uniquely identify this module
|
# ID used to uniquely identify this module
|
||||||
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
|
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#Requires -Version 5
|
||||||
function Read-Clipboard {
|
function Read-Clipboard {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
@@ -22,30 +23,24 @@ function Read-Clipboard {
|
|||||||
$Header
|
$Header
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($IsWindows) {
|
if ($IsLinux -or $IsMacOS) {
|
||||||
$osInfo = Get-CimInstance -ClassName Win32_OperatingSystem
|
Write-Error "Read-Clipboard only runs on Windows"
|
||||||
if ($osInfo.ProductType -eq 1) {
|
return
|
||||||
$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."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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 {
|
function ReadClipboardImpl {
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
# v7.2.2
|
||||||
|
|
||||||
|
- Improved checks for Linux, Mac and PS 5.1
|
||||||
|
|
||||||
# v7.2.1
|
# v7.2.1
|
||||||
|
|
||||||
- Improve auto-detection of data on the clipboard
|
- Improve auto-detection of data on the clipboard
|
||||||
|
|
||||||
# v7.2.0
|
# 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.
|
- 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