diff --git a/ImportExcel.psd1 b/ImportExcel.psd1 index 28b2dbf..2d4f540 100644 --- a/ImportExcel.psd1 +++ b/ImportExcel.psd1 @@ -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' diff --git a/Public/Read-Clipboard.ps1 b/Public/Read-Clipboard.ps1 index 8ec06ca..18f8160 100644 --- a/Public/Read-Clipboard.ps1 +++ b/Public/Read-Clipboard.ps1 @@ -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 { diff --git a/changelog.md b/changelog.md index 2e34c3c..745c249 100644 --- a/changelog.md +++ b/changelog.md @@ -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.