mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-15 07:43:23 +00:00
Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a4c2d7bd9 | ||
|
|
42cb5a316a | ||
|
|
536cdaa841 | ||
|
|
6cd9fad7ba | ||
|
|
829d854c3d | ||
|
|
b33a282740 | ||
|
|
73fc96166c | ||
|
|
00f7278115 | ||
|
|
956cf5aa49 | ||
|
|
877310e015 | ||
|
|
08bf877535 | ||
|
|
88e28a1d6c | ||
|
|
eb63fe259a | ||
|
|
6d97efc5c2 | ||
|
|
c567526eac | ||
|
|
ed210cc730 | ||
|
|
72f44ebcb9 | ||
|
|
f1d20ed163 | ||
|
|
02cf6bb3f3 | ||
|
|
5cd3897dfa | ||
|
|
fe4f2848ad | ||
|
|
4e89b3321a | ||
|
|
43b6ebf84f | ||
|
|
1ee9493bc0 | ||
|
|
8f0fc7397d | ||
|
|
4fa6fbda01 | ||
|
|
7177623104 | ||
|
|
487cf51abc | ||
|
|
ae31e9d39b | ||
|
|
9ba20b8ec8 | ||
|
|
9daefc2925 | ||
|
|
f0b4cb28f6 | ||
|
|
5f00f5cbbc | ||
|
|
d41fbf8a05 | ||
|
|
ebe49f1650 | ||
|
|
a3dced10e4 | ||
|
|
1e522c562b | ||
|
|
5ec299ff2d | ||
|
|
676ecc17e0 | ||
|
|
aa1b0018ab | ||
|
|
eabaab79c5 | ||
|
|
7a8bbb9771 | ||
|
|
85f2433ffc | ||
|
|
62c8d74a59 | ||
|
|
5e7b404daf | ||
|
|
91a1240408 | ||
|
|
e8c3d96f43 | ||
|
|
9417b25af1 | ||
|
|
a942f2133d | ||
|
|
533ed07ac8 | ||
|
|
09f35b5fd5 | ||
|
|
23a2ac394f | ||
|
|
50928e8e3b | ||
|
|
26827b0764 | ||
|
|
6c35d5b018 | ||
|
|
ab5600c9ba | ||
|
|
47dcc636d9 | ||
|
|
1768c0ac92 | ||
|
|
694fcdd8c1 | ||
|
|
0192f4d822 |
9
Examples/ImportColumns/ImportColumns.ps1
Normal file
9
Examples/ImportColumns/ImportColumns.ps1
Normal file
@@ -0,0 +1,9 @@
|
||||
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
|
||||
|
||||
# Create example file
|
||||
$xlFile = "$PSScriptRoot\ImportColumns.xlsx"
|
||||
Get-Process | Export-Excel -Path $xlFile
|
||||
# -ImportColumns will also arrange columns
|
||||
Import-Excel -Path $xlFile -ImportColumns @(1,3,2) -NoHeader -StartRow 1
|
||||
# Get only pm, npm, cpu, id, processname
|
||||
Import-Excel -Path $xlFile -ImportColumns @(6,7,12,25,46) | Format-Table -AutoSize
|
||||
14
Examples/InvokeExcelQuery/Examples.ps1
Normal file
14
Examples/InvokeExcelQuery/Examples.ps1
Normal file
@@ -0,0 +1,14 @@
|
||||
try { Import-Module $PSScriptRoot\..\..\ImportExcel.psd1 } catch { throw ; return }
|
||||
|
||||
$queries =
|
||||
'select * from [sheet1$A:A]',
|
||||
'select * from [sheet1$]',
|
||||
'select * from [sheet1$A2:E11]',
|
||||
'select F2,F5 from [sheet1$A2:E11]',
|
||||
'select * from [sheet1$A2:E11] where F2 = "Grocery"',
|
||||
'select F2 as [Category], F5 as [Discount], F5*2 as [DiscountPlus] from [sheet1$A2:E11]'
|
||||
|
||||
foreach ($query in $queries) {
|
||||
"query: $($query)"
|
||||
Invoke-ExcelQuery .\testOleDb.xlsx $query | Format-Table
|
||||
}
|
||||
BIN
Examples/InvokeExcelQuery/testOleDb.xlsx
Normal file
BIN
Examples/InvokeExcelQuery/testOleDb.xlsx
Normal file
Binary file not shown.
@@ -6,7 +6,7 @@
|
||||
RootModule = 'ImportExcel.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '7.2.1'
|
||||
ModuleVersion = '7.4.0'
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
|
||||
@@ -64,6 +64,7 @@ Check out the How To Videos https://www.youtube.com/watch?v=U3Ne_yX4tYo&list=PL5
|
||||
'Import-USPS',
|
||||
'Invoke-AllTests',
|
||||
'Invoke-Sum',
|
||||
'Invoke-ExcelQuery',
|
||||
'Join-Worksheet',
|
||||
'LineChart',
|
||||
'Merge-MultipleSheets',
|
||||
@@ -80,6 +81,7 @@ Check out the How To Videos https://www.youtube.com/watch?v=U3Ne_yX4tYo&list=PL5
|
||||
'Pivot',
|
||||
'Read-Clipboard',
|
||||
'ReadClipboardImpl',
|
||||
'Read-OleDbData',
|
||||
'Remove-Worksheet',
|
||||
'Select-Worksheet',
|
||||
'Send-SQLDataToExcel',
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
[string[]]$AsText,
|
||||
[string[]]$AsDate,
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String]$Password
|
||||
[String]$Password,
|
||||
[Int[]]$ImportColumns
|
||||
)
|
||||
end {
|
||||
$sw = [System.Diagnostics.Stopwatch]::StartNew()
|
||||
@@ -62,6 +63,16 @@
|
||||
)
|
||||
|
||||
try {
|
||||
if ($ImportColumns) {
|
||||
$end = $Worksheet.Dimension.End.Column
|
||||
# Check $ImportColumns
|
||||
if ($ImportColumns[0] -le 0) { throw "The first entry in ImportColumns must be equal or greater 1" ; return }
|
||||
# Check $StartColumn and $EndColumn
|
||||
if (($StartColumn -ne 1) -or ($EndColumn -ne $end)) { Write-Warning -Message "If ImportColumns is set, then individual StartColumn and EndColumn will be ignored." }
|
||||
# Replace $Columns with $ImportColumns
|
||||
$Columns = $ImportColumns
|
||||
}
|
||||
|
||||
if ($HeaderName) {
|
||||
$i = 0
|
||||
foreach ($H in $HeaderName) {
|
||||
@@ -84,7 +95,7 @@
|
||||
|
||||
foreach ($C in $Columns) {
|
||||
#allow "False" or "0" to be column headings
|
||||
$Worksheet.Cells[$StartRow, $C] | Where-Object {-not [string]::IsNullOrEmpty($_.Value) } | Select-Object @{N = 'Column'; E = { $C } }, Value
|
||||
$Worksheet.Cells[$StartRow, $C] | Where-Object { -not [string]::IsNullOrEmpty($_.Value) } | Select-Object @{N = 'Column'; E = { $C } }, Value
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,7 +196,7 @@
|
||||
}
|
||||
$TextColRegEx = New-Object -TypeName regex -ArgumentList $TextColExpression , 9
|
||||
}
|
||||
else {$TextColRegEx = $null}
|
||||
else { $TextColRegEx = $null }
|
||||
foreach ($R in $rows) {
|
||||
#Disabled write-verbose for speed
|
||||
# Write-Verbose "Import row '$R'"
|
||||
@@ -194,12 +205,12 @@
|
||||
foreach ($P in $PropertyNames) {
|
||||
$MatchTest = $TextColRegEx.Match($P.value)
|
||||
if ($MatchTest.groups.name -eq "astext") {
|
||||
$NewRow[$P.Value] = $Worksheet.Cells[$R, $P.Column].Text
|
||||
$NewRow[$P.Value] = $Worksheet.Cells[$R, $P.Column].Text
|
||||
}
|
||||
elseif ($MatchTest.groups.name -eq "asdate" -and $Worksheet.Cells[$R, $P.Column].Value -is [System.ValueType]) {
|
||||
$NewRow[$P.Value] = [datetime]::FromOADate(($Worksheet.Cells[$R, $P.Column].Value))
|
||||
$NewRow[$P.Value] = [datetime]::FromOADate(($Worksheet.Cells[$R, $P.Column].Value))
|
||||
}
|
||||
else { $NewRow[$P.Value] = $Worksheet.Cells[$R, $P.Column].Value }
|
||||
else { $NewRow[$P.Value] = $Worksheet.Cells[$R, $P.Column].Value }
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
63
Public/Invoke-ExcelQuery.ps1
Normal file
63
Public/Invoke-ExcelQuery.ps1
Normal file
@@ -0,0 +1,63 @@
|
||||
#Requires -Version 5
|
||||
function Invoke-ExcelQuery {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Helper method for executing Read-OleDbData with some basic defaults.
|
||||
|
||||
For additional help, see documentation for Read-OleDbData cmdlet.
|
||||
|
||||
.DESCRIPTION
|
||||
Uses Read-OleDbData to execute a sql statement against a xlsx file. For finer grained control over the interaction, you may use that cmdlet. This cmdlet assumes a file path will be passed in and the connection string will be built with no headers and treating all results as text.
|
||||
|
||||
Running this command is equivalent to running the following:
|
||||
|
||||
$FullName = (Get-ChildItem $Path).FullName
|
||||
Read-OleDbData `
|
||||
-ConnectionString "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$FullName;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'" `
|
||||
-SqlStatement $Query
|
||||
|
||||
Note that this command uses the MICROSOFT.ACE.OLEDB provider and will not work without it.
|
||||
|
||||
If needed, please download the appropriate package from https://www.microsoft.com/en-us/download/details.aspx?id=54920.
|
||||
|
||||
.EXAMPLE
|
||||
Invoke-ExcelQuery .\test.xlsx 'select ROUND(F1) as [A1] from [sheet3$A1:A1]'
|
||||
|
||||
.EXAMPLE
|
||||
$Path = (Get-ChildItem 'test.xlsx').FullName
|
||||
$Query = "select ROUND(F1) as [A] from [sheet1$A1:A1]"
|
||||
Read-XlsxUsingOleDb -Path $Path -Query $Query
|
||||
|
||||
.EXAMPLE
|
||||
$ReadDataArgs = @{
|
||||
Path = .\test.xlsx
|
||||
Query = Get-Content query.sql -Raw
|
||||
}
|
||||
$Results = Invoke-ExcelQuery @ReadDataArgs
|
||||
#>
|
||||
param(
|
||||
#The path to the file to open.
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String] $Path, # var name consistent with Import-Excel
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String] $Query # var name consistent with Invoke-Sqlcmd
|
||||
)
|
||||
|
||||
try {
|
||||
if ((New-Object system.data.oledb.oledbenumerator).GetElements().SOURCES_NAME -notcontains "Microsoft.ACE.OLEDB.12.0") {
|
||||
Write-Error "Microsoft.ACE.OLEDB.12.0 provider is missing! Please install from https://www.microsoft.com/en-us/download/details.aspx?id=54920"
|
||||
return
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Error "System.Data.OleDb is not working or you are on an unsupported platform."
|
||||
return
|
||||
}
|
||||
|
||||
$FullName = (Get-ChildItem $Path).FullName
|
||||
Read-OleDbData `
|
||||
-ConnectionString "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$FullName;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'" `
|
||||
-SqlStatement $Query
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
function Open-ExcelPackage {
|
||||
function Open-ExcelPackage {
|
||||
[CmdLetBinding()]
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword","")]
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "")]
|
||||
[OutputType([OfficeOpenXml.ExcelPackage])]
|
||||
param(
|
||||
#The path to the file to open.
|
||||
[Parameter(Mandatory=$true)]$Path,
|
||||
[Parameter(Mandatory = $true)]$Path,
|
||||
#If specified, any running instances of Excel will be terminated before opening the file.
|
||||
[switch]$KillExcel,
|
||||
#The password for a protected worksheet, as a [normal] string (not a secure string).
|
||||
@@ -13,7 +13,7 @@
|
||||
[switch]$Create
|
||||
)
|
||||
|
||||
if($KillExcel) {
|
||||
if ($KillExcel) {
|
||||
Get-Process -Name "excel" -ErrorAction Ignore | Stop-Process
|
||||
while (Get-Process -Name "excel" -ErrorAction Ignore) {}
|
||||
}
|
||||
@@ -24,21 +24,26 @@
|
||||
#Create the directory if required.
|
||||
$targetPath = Split-Path -Parent -Path $Path
|
||||
if (!(Test-Path -Path $targetPath)) {
|
||||
Write-Debug "Base path $($targetPath) does not exist, creating"
|
||||
$null = New-item -ItemType Directory -Path $targetPath -ErrorAction Ignore
|
||||
Write-Debug "Base path $($targetPath) does not exist, creating"
|
||||
$null = New-item -ItemType Directory -Path $targetPath -ErrorAction Ignore
|
||||
}
|
||||
New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $Path
|
||||
}
|
||||
elseif (Test-Path -Path $path) {
|
||||
if ($Password) {$pkgobj = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $Path , $Password }
|
||||
else {$pkgobj = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $Path }
|
||||
if ($Password) { $pkgobj = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $Path , $Password }
|
||||
else { $pkgobj = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $Path }
|
||||
if ($pkgobj) {
|
||||
foreach ($w in $pkgobj.Workbook.Worksheets) {
|
||||
$sb = [scriptblock]::Create(('$this.workbook.Worksheets["{0}"]' -f $w.name))
|
||||
Add-Member -InputObject $pkgobj -MemberType ScriptProperty -Name $w.name -Value $sb
|
||||
try {
|
||||
Add-Member -InputObject $pkgobj -MemberType ScriptProperty -Name $w.name -Value $sb -ErrorAction Stop
|
||||
}
|
||||
catch {
|
||||
Write-Warning "Could not add sheet $($w.name) as 'short cut', you need to access it via `$wb.Worksheets['$($w.name)'] "
|
||||
}
|
||||
}
|
||||
return $pkgobj
|
||||
}
|
||||
}
|
||||
else {Write-Warning "Could not find $path" }
|
||||
}
|
||||
else { Write-Warning "Could not find $path" }
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
54
Public/Read-OleDbData.ps1
Normal file
54
Public/Read-OleDbData.ps1
Normal file
@@ -0,0 +1,54 @@
|
||||
#Requires -Version 5
|
||||
function Read-OleDbData {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Read data from an OleDb source using dotnet classes. This allows for OleDb queries against excel spreadsheets. Examples will only be for querying xlsx files.
|
||||
|
||||
For additional documentation, see Microsoft's documentation on the System.Data OleDb namespace here:
|
||||
https://docs.microsoft.com/en-us/dotnet/api/system.data.oledb
|
||||
|
||||
.DESCRIPTION
|
||||
Read data from an OleDb source using dotnet classes. This allows for OleDb queries against excel spreadsheets. Examples will only be for querying xlsx files using ACE.
|
||||
|
||||
.EXAMPLE
|
||||
Read-OleDbData `
|
||||
-ConnectionString "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=file.xlsx;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'" `
|
||||
-SqlStatement "select ROUND(F1) as [A] from [sheet1$A1:A1]"
|
||||
|
||||
.EXAMPLE
|
||||
$ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=file.xlsx;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'"
|
||||
$SqlStatement = "select ROUND(F1) as [A] from [sheet1$A1:A1]"
|
||||
Read-OleDbData -ConnectionString $ConnectionString -SqlStatement $SqlStatement
|
||||
|
||||
.EXAMPLE
|
||||
$ReadDataArgs = @{
|
||||
SqlStatement = Get-Content query.sql -Raw
|
||||
ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=file.xlsx;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'"
|
||||
}
|
||||
$Results = Read-OleDbData @ReadDataArgs
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String] $ConnectionString,
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[String] $SqlStatement
|
||||
)
|
||||
|
||||
try {
|
||||
if ((New-Object system.data.oledb.oledbenumerator).GetElements().SOURCES_NAME -notcontains "Microsoft.ACE.OLEDB.12.0") {
|
||||
Write-Warning "Microsoft.ACE.OLEDB.12.0 provider is missing! You will not be able to query Excel files without it. Please install from https://www.microsoft.com/en-us/download/details.aspx?id=54920"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Error "System.Data.OleDb is not working or you are on an unsupported platform."
|
||||
return
|
||||
}
|
||||
|
||||
$DataTable = new-object System.Data.DataTable
|
||||
$DataAdapter = new-object System.Data.OleDb.OleDbDataAdapter $SqlStatement, $ConnectionString
|
||||
$null = $DataAdapter.Fill($DataTable)
|
||||
$null = $DataAdapter.Dispose()
|
||||
$DataTable.Rows | Select-Object $DataTable.Columns.ColumnName
|
||||
}
|
||||
@@ -1,33 +1,66 @@
|
||||
#Requires -Modules Pester
|
||||
|
||||
if (-not (Get-command Import-Excel -ErrorAction SilentlyContinue)) {
|
||||
Import-Module $PSScriptRoot\..\ImportExcel.psd1
|
||||
}
|
||||
|
||||
Describe "Import-Excel on a sheet with no headings" {
|
||||
BeforeAll {
|
||||
|
||||
$xlfile = "TestDrive:\testImportExcel.xlsx"
|
||||
$xlfileHeaderOnly = "TestDrive:\testImportExcelHeaderOnly.xlsx"
|
||||
$xl = "" | Export-excel $xlfile -PassThru
|
||||
$xlfile = "$PSScriptRoot\testImportExcel.xlsx"
|
||||
$xlfileHeaderOnly = "$PSScriptRoot\testImportExcelHeaderOnly.xlsx"
|
||||
$xlfileImportColumns = "$PSScriptRoot\testImportExcelImportColumns.xlsx"
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A1 -Value 'A'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B1 -Value 'B'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C1 -Value 'C'
|
||||
# Create $xlfile if it does not exist
|
||||
if (!(Test-Path -Path $xlfile)) {
|
||||
$xl = "" | Export-excel $xlfile -PassThru
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A2 -Value 'D'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B2 -Value 'E'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C2 -Value 'F'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A1 -Value 'A'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B1 -Value 'B'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C1 -Value 'C'
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A2 -Value 'D'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B2 -Value 'E'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C2 -Value 'F'
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A3 -Value 'G'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B3 -Value 'H'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C3 -Value 'I'
|
||||
|
||||
Close-ExcelPackage $xl
|
||||
}
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A3 -Value 'G'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B3 -Value 'H'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C3 -Value 'I'
|
||||
# Create $xlfileHeaderOnly if it does not exist
|
||||
if (!(Test-Path -Path $xlfileHeaderOnly)) {
|
||||
$xl = "" | Export-excel $xlfileHeaderOnly -PassThru
|
||||
|
||||
Close-ExcelPackage $xl
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A1 -Value 'A'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B1 -Value 'B'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C1 -Value 'C'
|
||||
|
||||
# crate $xlfileHeaderOnly
|
||||
$xl = "" | Export-excel $xlfileHeaderOnly -PassThru
|
||||
Close-ExcelPackage $xl
|
||||
}
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A1 -Value 'A'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B1 -Value 'B'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C1 -Value 'C'
|
||||
# Create $xlfileImportColumns if it does not exist
|
||||
if (!(Test-Path -Path $xlfileImportColumns)) {
|
||||
$xl = "" | Export-Excel $xlfileImportColumns -PassThru
|
||||
|
||||
Close-ExcelPackage $xl
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A1 -Value 'A'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B1 -Value 'B'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C1 -Value 'C'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range D1 -Value 'D'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range E1 -Value 'E'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range F1 -Value 'F'
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A2 -Value '1'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range B2 -Value '2'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range C2 -Value '3'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range D2 -Value '4'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range E2 -Value '5'
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range F2 -Value '6'
|
||||
|
||||
Close-ExcelPackage $xl
|
||||
}
|
||||
}
|
||||
|
||||
It "Import-Excel should have this shape" {
|
||||
@@ -167,7 +200,7 @@ Describe "Import-Excel on a sheet with no headings" {
|
||||
}
|
||||
|
||||
It "Should" {
|
||||
$xlfile = "TestDrive:\testImportExcelSparse.xlsx"
|
||||
$xlfile = "$PSScriptRoot\testImportExcelSparse.xlsx"
|
||||
$xl = "" | Export-excel $xlfile -PassThru
|
||||
|
||||
Set-ExcelRange -Worksheet $xl.Sheet1 -Range A1 -Value 'Chuck'
|
||||
@@ -224,4 +257,139 @@ Describe "Import-Excel on a sheet with no headings" {
|
||||
$actual[0].P2 | Should -Be 'B'
|
||||
$actual[0].P3 | Should -Be 'C'
|
||||
}
|
||||
|
||||
It "Should import correct data if -ImportColumns is used with the first column" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(1,2,4,5))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 4
|
||||
$actualNames[0] | Should -Be 'A'
|
||||
$actualNames[2] | Should -Be 'D'
|
||||
|
||||
$actual.Count | Should -Be 1
|
||||
$actual[0].A | Should -Be 1
|
||||
$actual[0].B | Should -Be 2
|
||||
$actual[0].D | Should -Be 4
|
||||
$actual[0].E | Should -Be 5
|
||||
}
|
||||
|
||||
It "Should import correct data if -ImportColumns is used with the first column" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(1,3,4,5))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 4
|
||||
$actualNames[0] | Should -Be 'A'
|
||||
$actualNames[2] | Should -Be 'D'
|
||||
|
||||
$actual.Count | Should -Be 1
|
||||
$actual[0].A | Should -Be 1
|
||||
$actual[0].C | Should -Be 3
|
||||
$actual[0].D | Should -Be 4
|
||||
$actual[0].E | Should -Be 5
|
||||
}
|
||||
|
||||
It "Should import correct data if -ImportColumns is used without the first column" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(2,3,6))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 3
|
||||
$actualNames[0] | Should -Be 'B'
|
||||
$actualNames[2] | Should -Be 'F'
|
||||
|
||||
$actual.Count | Should -Be 1
|
||||
$actual[0].B | Should -Be 2
|
||||
$actual[0].C | Should -Be 3
|
||||
$actual[0].F | Should -Be 6
|
||||
}
|
||||
|
||||
It "Should import correct data if -ImportColumns is used without the first column" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(2,5,6))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 3
|
||||
$actualNames[0] | Should -Be 'B'
|
||||
$actualNames[2] | Should -Be 'F'
|
||||
|
||||
$actual.Count | Should -Be 1
|
||||
$actual[0].B | Should -Be 2
|
||||
$actual[0].E | Should -Be 5
|
||||
$actual[0].F | Should -Be 6
|
||||
}
|
||||
|
||||
It "Should import correct data if -ImportColumns is used with only 1 column" {
|
||||
$actual = @(Import-Excel $xlfile -ImportColumns @(2))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 1
|
||||
$actualNames[0] | Should -Be 'B'
|
||||
|
||||
$actual.Count | Should -Be 2
|
||||
$actual[0].B | Should -Be 'E'
|
||||
}
|
||||
|
||||
It "Should import correct data if -ImportColumns is used with only 1 column which is also the last" {
|
||||
$actual = @(Import-Excel $xlfile -ImportColumns @(3))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 1
|
||||
$actualNames[0] | Should -Be 'C'
|
||||
|
||||
$actual.Count | Should -Be 2
|
||||
$actual[1].C | Should -Be 'I'
|
||||
}
|
||||
|
||||
It "Should import correct data if -ImportColumns contains all columns" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(1,2,3,4,5,6))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 6
|
||||
$actualNames[0] | Should -Be 'A'
|
||||
$actualNames[2] | Should -Be 'C'
|
||||
|
||||
$actual.Count | Should -Be 1
|
||||
$actual[0].A | Should -Be 1
|
||||
$actual[0].B | Should -Be 2
|
||||
$actual[0].C | Should -Be 3
|
||||
$actual[0].D | Should -Be 4
|
||||
$actual[0].E | Should -Be 5
|
||||
$actual[0].F | Should -Be 6
|
||||
}
|
||||
|
||||
It "Should ignore -StartColumn and -EndColumn if -ImportColumns is set aswell" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(5) -StartColumn 2 -EndColumn 7)
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 1
|
||||
$actualNames[0] | Should -Be 'E'
|
||||
|
||||
$actual[0].E | Should -Be '5'
|
||||
}
|
||||
|
||||
It "Should arrange the columns if -ImportColumns is not in order" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(5,1,4))
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 3
|
||||
$actualNames[0] | Should -Be 'E'
|
||||
$actualNames[1] | Should -Be 'A'
|
||||
$actualNames[2] | Should -Be 'D'
|
||||
|
||||
$actual[0].E | Should -Be '5'
|
||||
$actual[0].A | Should -Be '1'
|
||||
$actual[0].D | Should -Be '4'
|
||||
}
|
||||
|
||||
It "Should arrange the columns if -ImportColumns is not in order and -NoHeader is used" {
|
||||
$actual = @(Import-Excel $xlfileImportColumns -ImportColumns @(5,1,4) -NoHeader -StartRow 2)
|
||||
$actualNames = $actual[0].psobject.properties.Name
|
||||
|
||||
$actualNames.Count | Should -Be 3
|
||||
$actualNames[0] | Should -Be 'P1'
|
||||
$actualNames[1] | Should -Be 'P2'
|
||||
$actualNames[2] | Should -Be 'P3'
|
||||
|
||||
$actual[0].P1 | Should -Be '5'
|
||||
$actual[0].P2 | Should -Be '1'
|
||||
$actual[0].P3 | Should -Be '4'
|
||||
}
|
||||
}
|
||||
39
__tests__/Open-ExcelPackage.tests.ps1
Normal file
39
__tests__/Open-ExcelPackage.tests.ps1
Normal file
@@ -0,0 +1,39 @@
|
||||
#Requires -Modules Pester
|
||||
|
||||
if (-not (Get-command Import-Excel -ErrorAction SilentlyContinue)) {
|
||||
Import-Module $PSScriptRoot\..\ImportExcel.psd1
|
||||
}
|
||||
|
||||
<#
|
||||
Methods
|
||||
-------
|
||||
Dispose
|
||||
Equals
|
||||
GetAsByteArray
|
||||
GetHashCode
|
||||
GetType
|
||||
Load
|
||||
Save
|
||||
SaveAs
|
||||
ToString
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
Compatibility
|
||||
Compression
|
||||
DoAdjustDrawings
|
||||
Encryption
|
||||
File
|
||||
Package
|
||||
Stream
|
||||
Workbook
|
||||
#>
|
||||
|
||||
Describe "Test Open Excel Package" -Tag Open-ExcelPackage {
|
||||
It "Should handle opening a workbook with Worksheet Names that will cause errors" {
|
||||
$xlFilename = "$PSScriptRoot\UnsupportedWorkSheetNames.xlsx"
|
||||
|
||||
{ Open-ExcelPackage -Path $xlFilename -ErrorAction Stop } | Should -Not -Throw
|
||||
}
|
||||
}
|
||||
46
__tests__/Read-OleDbDataTests/Invoke-ExcelQuery.Tests.ps1
Normal file
46
__tests__/Read-OleDbDataTests/Invoke-ExcelQuery.Tests.ps1
Normal file
@@ -0,0 +1,46 @@
|
||||
#Requires -Modules Pester
|
||||
if (-not (Get-command Import-Excel -ErrorAction SilentlyContinue)) {
|
||||
Import-Module $PSScriptRoot\..\ImportExcel.psd1
|
||||
}
|
||||
|
||||
$skip = $false
|
||||
if ($IsLinux -or $IsMacOS) {
|
||||
$skip = $true
|
||||
Write-Warning "Invoke-ExcelQuery: Linux and MacOs are not supported. Skipping tests."
|
||||
}else{
|
||||
try {
|
||||
if ((New-Object system.data.oledb.oledbenumerator).GetElements().SOURCES_NAME -notcontains "Microsoft.ACE.OLEDB.12.0") {
|
||||
$skip = $true
|
||||
Write-Warning "Invoke-ExcelQuery: Microsoft.ACE.OLEDB.12.0 provider not found. Skipping tests."
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$skip = $true
|
||||
Write-Warning "Invoke-ExcelQuery: Calls to System.Data.OleDb failed. Skipping tests."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Describe "Invoke-ExcelQuery" -Tag "Invoke-ExcelQuery" {
|
||||
$PSDefaultParameterValues = @{ 'It:Skip' = $skip }
|
||||
BeforeAll {
|
||||
$tfp = "$PSScriptRoot\Read-OleDbData.xlsx"
|
||||
}
|
||||
Context "Basic Checks" {
|
||||
It "Should have a valid Test file" {
|
||||
Test-Path $tfp | Should -Be $true
|
||||
}
|
||||
It "Should have the Read-OleDbData command loaded" {
|
||||
(Get-Command Read-OleDbData -ErrorAction SilentlyContinue) -ne $null | Should -Be $true
|
||||
}
|
||||
It "Should have the Invoke-ExcelQuery command loaded" {
|
||||
(Get-Command Invoke-ExcelQuery -ErrorAction SilentlyContinue) -ne $null | Should -Be $true
|
||||
}
|
||||
}
|
||||
Context "Sheet1`$A1" {
|
||||
It "Should return 1 result with a value of 1" {
|
||||
$Results = Invoke-ExcelQuery $tfp "select ROUND(F1) as [A1] from [sheet1`$A1:A1]"
|
||||
@($Results).length + $Results.A1 | Should -Be 2
|
||||
}
|
||||
}
|
||||
}
|
||||
4
__tests__/Read-OleDbDataTests/Read-OleDbData.TestA.sql
Normal file
4
__tests__/Read-OleDbDataTests/Read-OleDbData.TestA.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
select
|
||||
ROUND(F1) as [A1]
|
||||
from
|
||||
[sheet3$A1:A1]
|
||||
7
__tests__/Read-OleDbDataTests/Read-OleDbData.TestB.sql
Normal file
7
__tests__/Read-OleDbDataTests/Read-OleDbData.TestB.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
select ROUND(F1) as [A1] from [sheet1$A1:A1]
|
||||
union all select ROUND(F1) as [A1] from [sheet2$A1:A1]
|
||||
union all select ROUND(F1) as [A1] from [sheet3$A1:A1]
|
||||
union all select ROUND(F1) as [A1] from [sheet4$A1:A1]
|
||||
union all select ROUND(F1) as [A1] from [sheet5$A1:A1]
|
||||
union all select ROUND(F1) as [A1] from [sheet6$A1:A1]
|
||||
union all select ROUND(F1) as [A1] from [sheet7$A1:A1]
|
||||
4
__tests__/Read-OleDbDataTests/Read-OleDbData.TestC.sql
Normal file
4
__tests__/Read-OleDbDataTests/Read-OleDbData.TestC.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
select
|
||||
*
|
||||
from
|
||||
[sheet1$A1:E10]
|
||||
10
__tests__/Read-OleDbDataTests/Read-OleDbData.TestD.sql
Normal file
10
__tests__/Read-OleDbDataTests/Read-OleDbData.TestD.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
select top 1
|
||||
'All A1s' as [A1],
|
||||
F1 as [Sheet1],
|
||||
(select F1 FROM [sheet2$a1:a1]) as [Sheet2],
|
||||
(select F1 FROM [sheet3$a1:a1]) as [Sheet3],
|
||||
(select F1 FROM [sheet4$a1:a1]) as [Sheet4],
|
||||
(select F1 FROM [sheet5$a1:a1]) as [Sheet5],
|
||||
(select F1 FROM [sheet6$a1:a1]) as [Sheet6],
|
||||
(select F1 FROM [sheet7$a1:a1]) as [Sheet7]
|
||||
FROM [sheet1$a1:a1]
|
||||
31
__tests__/Read-OleDbDataTests/Read-OleDbData.TestE.sql
Normal file
31
__tests__/Read-OleDbDataTests/Read-OleDbData.TestE.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
select top 1
|
||||
'All A1s Start from Sheet1' as [A1],
|
||||
F1 as [Sheet1],
|
||||
(select F1 FROM [sheet2$a1:a1]) as [Sheet2],
|
||||
(select F1 FROM [sheet3$a1:a1]) as [Sheet3],
|
||||
(select F1 FROM [sheet4$a1:a1]) as [Sheet4]
|
||||
FROM [sheet1$a1:a1]
|
||||
UNION ALL
|
||||
select top 1
|
||||
'All A1s Start from Sheet2' as [A1],
|
||||
(select F1 FROM [sheet1$a1:a1]) as [Sheet1],
|
||||
F1 as [Sheet2],
|
||||
(select F1 FROM [sheet3$a1:a1]) as [Sheet3],
|
||||
(select F1 FROM [sheet4$a1:a1]) as [Sheet4]
|
||||
FROM [sheet2$a1:a1]
|
||||
UNION ALL
|
||||
select top 1
|
||||
'All A1s Start from Sheet3' as [A1],
|
||||
(select F1 FROM [sheet1$a1:a1]) as [Sheet1],
|
||||
(select F1 FROM [sheet2$a1:a1]) as [Sheet2],
|
||||
F1 as [Sheet3],
|
||||
(select F1 FROM [sheet4$a1:a1]) as [Sheet4]
|
||||
FROM [sheet3$a1:a1]
|
||||
UNION ALL
|
||||
select top 1
|
||||
'All A1s Start from Sheet4' as [A1],
|
||||
(select F1 FROM [sheet1$a1:a1]) as [Sheet1],
|
||||
(select F1 FROM [sheet2$a1:a1]) as [Sheet2],
|
||||
(select F1 FROM [sheet3$a1:a1]) as [Sheet3],
|
||||
F1 as [Sheet4]
|
||||
FROM [sheet4$a1:a1]
|
||||
92
__tests__/Read-OleDbDataTests/Read-OleDbData.Tests.ps1
Normal file
92
__tests__/Read-OleDbDataTests/Read-OleDbData.Tests.ps1
Normal file
@@ -0,0 +1,92 @@
|
||||
#Requires -Modules Pester
|
||||
if (-not (Get-command Import-Excel -ErrorAction SilentlyContinue)) {
|
||||
Import-Module $PSScriptRoot\..\ImportExcel.psd1
|
||||
}
|
||||
|
||||
$skip = $false
|
||||
if ($IsLinux -or $IsMacOS) {
|
||||
$skip = $true
|
||||
Write-Warning "Read-OleDbData: Linux and MacOs are not supported. Skipping tests."
|
||||
}else{
|
||||
try {
|
||||
if ((New-Object system.data.oledb.oledbenumerator).GetElements().SOURCES_NAME -notcontains "Microsoft.ACE.OLEDB.12.0") {
|
||||
$skip = $true
|
||||
Write-Warning "Read-OleDbData: Microsoft.ACE.OLEDB.12.0 provider not found. Skipping tests."
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$skip = $true
|
||||
Write-Warning "Read-OleDbData: Calls to System.Data.OleDb failed. Skipping tests."
|
||||
}
|
||||
}
|
||||
Describe "Read-OleDbData" -Tag "Read-OleDbData" {
|
||||
$PSDefaultParameterValues = @{ 'It:Skip' = $skip }
|
||||
BeforeAll {
|
||||
$scriptPath = $PSScriptRoot
|
||||
$tfp = "$scriptPath\Read-OleDbData.xlsx"
|
||||
$cs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$tfp;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'"
|
||||
}
|
||||
Context "Basic Tests" {
|
||||
It "Should have a valid Test file" {
|
||||
Test-Path $tfp | Should -Be $true
|
||||
}
|
||||
It "Should have the Read-OleDbData command loaded" {
|
||||
(Get-Command Read-OleDbData -ErrorAction SilentlyContinue) -ne $null | Should -Be $true
|
||||
}
|
||||
It "Should be able to open spreadsheet" {
|
||||
$null = Read-OleDbData -ConnectionString $cs -SqlStatement "select 1"
|
||||
$true | Should -Be $true
|
||||
}
|
||||
It "Should return PSCustomObject for single result" {
|
||||
#multiple records will come back as Object[], but not going to test for that
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement "select 1"
|
||||
$Results.GetType().Name | Should -Be 'PSCustomObject'
|
||||
}
|
||||
}
|
||||
Context "Sheet1`$A1" {
|
||||
It "Should return 1 result with a value of 1" {
|
||||
$sql = "select ROUND(F1) as [A1] from [sheet1`$A1:A1]"
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement $sql
|
||||
@($Results).length + $Results.A1 | Should -Be 2
|
||||
}
|
||||
}
|
||||
Context "Sheet2`$A1" {
|
||||
It "Should return 1 result with value of 2" {
|
||||
$sql = "select ROUND(F1) as [A1] from [sheet2`$A1:A1]"
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement $sql
|
||||
@($Results).length + $Results.A1 | Should -Be 3
|
||||
}
|
||||
}
|
||||
Context "Sheet3`$A1, Sql from file" {
|
||||
It "Should return 1 result with value of 3" {
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement (Get-Content "$scriptPath\Read-OleDbData.TestA.sql" -raw)
|
||||
@($Results).length + $Results.A1 | Should -Be 4
|
||||
}
|
||||
}
|
||||
Context "Sheets[1-7]`$A1, Sql from file" {
|
||||
It "Should return 7 result with where sum values 1-6 = value 7" {
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement (Get-Content "$scriptPath\Read-OleDbData.TestB.sql" -raw)
|
||||
$a = $Results.A1
|
||||
$a.length + ($a[0..5] | Measure-Object -sum).sum | Should -Be (7 + $a[6])
|
||||
}
|
||||
}
|
||||
Context "Sheet1`$:A1:E10, Sql from file" {
|
||||
#note, this spreadsheet doesn't have the fields populated other than A1, so it will, correctly, return only one value
|
||||
It "Should return 1 result with value of 1" {
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement (Get-Content "$scriptPath\Read-OleDbData.TestC.sql" -raw)
|
||||
@($Results).length + $Results.F1 | Should -Be 2
|
||||
}
|
||||
}
|
||||
Context "When Read-OleDbData.xlsx, select a1 from all sheets as a single record, and sql is in a file" {
|
||||
It "should return one row with 8 columns" {
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement (Get-Content "$scriptPath\Read-OleDbData.TestD.sql" -raw)
|
||||
@($Results).length + @($Results.psobject.Properties).length | Should -Be 9
|
||||
}
|
||||
}
|
||||
Context "When Read-OleDbData.xlsx, select a1 from all sheets as a single record multiple times to create a range, and sql is in a file" {
|
||||
It "should return 4 records with 5 columns" {
|
||||
$Results = Read-OleDbData -ConnectionString $cs -SqlStatement (Get-Content "$scriptPath\Read-OleDbData.TestE.sql" -raw)
|
||||
@($Results).length + @($Results[0].psobject.Properties).length | Should -Be 9
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
__tests__/Read-OleDbDataTests/Read-OleDbData.xlsx
Normal file
BIN
__tests__/Read-OleDbDataTests/Read-OleDbData.xlsx
Normal file
Binary file not shown.
BIN
__tests__/UnsupportedWorkSheetNames.xlsx
Normal file
BIN
__tests__/UnsupportedWorkSheetNames.xlsx
Normal file
Binary file not shown.
BIN
__tests__/testImportExcel.xlsx
Normal file
BIN
__tests__/testImportExcel.xlsx
Normal file
Binary file not shown.
BIN
__tests__/testImportExcelHeaderOnly.xlsx
Normal file
BIN
__tests__/testImportExcelHeaderOnly.xlsx
Normal file
Binary file not shown.
BIN
__tests__/testImportExcelImportColumns.xlsx
Normal file
BIN
__tests__/testImportExcelImportColumns.xlsx
Normal file
Binary file not shown.
BIN
__tests__/testImportExcelSparse.xlsx
Normal file
BIN
__tests__/testImportExcelSparse.xlsx
Normal file
Binary file not shown.
@@ -20,6 +20,25 @@ jobs:
|
||||
vmImage: 'windows-latest'
|
||||
|
||||
steps:
|
||||
|
||||
# BEGIN - ACE support for Invoke-ExcelQuery testing
|
||||
- task: Cache@2
|
||||
inputs:
|
||||
key: v2 | "$(Agent.OS)" | ace
|
||||
path: ace
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: Cache ACE
|
||||
|
||||
- bash: |
|
||||
mkdir ./ace
|
||||
curl -o ./ace/ace.exe https://download.microsoft.com/download/3/5/C/35C84C36-661A-44E6-9324-8786B8DBE231/accessdatabaseengine_X64.exe
|
||||
displayName: 'Download ACE'
|
||||
condition: ne(variables.CACHE_RESTORED, 'true')
|
||||
|
||||
- powershell: Start-Process ./ace/ace.exe -Wait -ArgumentList "/quiet /passive /norestart"
|
||||
displayName: 'Install ACE for Invoke-ExcelQuery testing'
|
||||
# END - ACE support for Invoke-ExcelQuery testing
|
||||
|
||||
- powershell: 'Install-Module -Name Pester -Force -SkipPublisherCheck'
|
||||
displayName: 'Update Pester'
|
||||
- powershell: './CI/CI.ps1 -Test'
|
||||
@@ -49,6 +68,25 @@ jobs:
|
||||
vmImage: 'windows-latest'
|
||||
|
||||
steps:
|
||||
|
||||
# BEGIN - ACE support for Invoke-ExcelQuery testing
|
||||
- task: Cache@2
|
||||
inputs:
|
||||
key: v2 | "$(Agent.OS)" | ace
|
||||
path: ace
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: Cache ACE
|
||||
|
||||
- bash: |
|
||||
mkdir ./ace
|
||||
curl -o ./ace/ace.exe https://download.microsoft.com/download/3/5/C/35C84C36-661A-44E6-9324-8786B8DBE231/accessdatabaseengine_X64.exe
|
||||
displayName: 'Download ACE'
|
||||
condition: ne(variables.CACHE_RESTORED, 'true')
|
||||
|
||||
- powershell: Start-Process ./ace/ace.exe -Wait -ArgumentList "/quiet /passive /norestart"
|
||||
displayName: 'Install ACE for Invoke-ExcelQuery testing'
|
||||
# END - ACE support for Invoke-ExcelQuery testing
|
||||
|
||||
- pwsh: 'Install-Module -Name Pester -Force'
|
||||
displayName: 'Update Pester'
|
||||
- pwsh: './CI/CI.ps1 -Test'
|
||||
|
||||
59
changelog.md
59
changelog.md
@@ -1,7 +1,66 @@
|
||||
# v7.4.0
|
||||
|
||||
- Thank you to [Max Goczall](https://github.com/muschebubusche) for this contribution!
|
||||
- `ImportColumns` parameter added to `ImportExcel`. It is used to define which columns of the ExcelPackage should be imported.
|
||||
|
||||
```powershell
|
||||
Import-Excel -Path $xlFile -ImportColumns @(6,7,12,25,46)
|
||||
```
|
||||
|
||||
# v7.3.1
|
||||
|
||||
- Added query Excel spreadsheets, with SQL queries!
|
||||
|
||||
```powershell
|
||||
$query = 'select F2 as [Category], F5 as [Discount], F5*2 as [DiscountPlus] from [sheet1$A2:E11]'
|
||||
|
||||
Invoke-ExcelQuery .\testOleDb.xlsx $query
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Result
|
||||
|
||||
```
|
||||
Category Discount DiscountPlus
|
||||
-------- -------- ------------
|
||||
Cosmetics 0.7 1.4
|
||||
Grocery 0.3 0.6
|
||||
Apparels 0.2 0.4
|
||||
Electronics 0.1 0.2
|
||||
Electronics 0 0
|
||||
Apparels 0.8 1.6
|
||||
Electronics 0.7 1.4
|
||||
Cosmetics 0.6 1.2
|
||||
Grocery 0.4 0.8
|
||||
Grocery 0.3 0.6
|
||||
```
|
||||
|
||||
- Thank you to Roy Ashbrook for the SQL query code. Catch up with Roy:
|
||||
|
||||
|Media|Link|
|
||||
|---|---|
|
||||
|twitter|https://twitter.com/royashbrook
|
||||
|github|https://github.com/royashbrook
|
||||
|linkedin|https://linkedin.com/in/royashbrook
|
||||
|blog|https://ashbrook.io
|
||||
|
||||
# v7.3.0
|
||||
|
||||
- Fix throwing error when a Worksheet name collides with a method, or property name on the `OfficeOpenXml.ExcelPackage` package
|
||||
|
||||
# v7.2.3
|
||||
|
||||
- Fix inline help, thank you [Wes Stahler](https://github.com/stahler)
|
||||
|
||||
# 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.
|
||||
|
||||
BIN
images/SQL-Spreadsheet.png
Normal file
BIN
images/SQL-Spreadsheet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -9,7 +9,7 @@ schema: 2.0.0
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
Returns an ExcelPackage object for the specified XLSX fil.e
|
||||
Returns an ExcelPackage object for the specified XLSX file.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# Public
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: null
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# ConvertFrom-ExcelData
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
Reads data from a sheet, and for each row, calls a custom scriptblock with a list of property names and the row of data.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
ConvertFrom-ExcelData [-Path] <Object> [[-ScriptBlock] <ScriptBlock>] [[-WorksheetName] <Object>]
|
||||
[[-HeaderRow] <Int32>] [[-Header] <String[]>] [-NoHeader] [-DataOnly] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### EXAMPLE 1
|
||||
|
||||
```text
|
||||
ConvertFrom-ExcelData .\testSQLGen.xlsx {
|
||||
```
|
||||
|
||||
param\($propertyNames, $record\)
|
||||
|
||||
```text
|
||||
$reportRecord = @()
|
||||
foreach ($pn in $propertyNames) {
|
||||
$reportRecord += "{0}: {1}" -f $pn, $record.$pn
|
||||
}
|
||||
$reportRecord +=""
|
||||
$reportRecord -join "\`r\`n"
|
||||
```
|
||||
|
||||
}
|
||||
|
||||
First: John Last: Doe The Zip: 12345 ....
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Path
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases: FullName
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByPropertyName, ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ScriptBlock
|
||||
|
||||
```yaml
|
||||
Type: ScriptBlock
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WorksheetName
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases: Sheet
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: 1
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HeaderRow
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: 1
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Header
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -NoHeader
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -DataOnly
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: null
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# ConvertTo-ExcelXlsx
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
Converts an Excel xls to a xlsx using -ComObject
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
ConvertTo-ExcelXlsx [-Path] <String> [-Force] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Path
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Force
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-ExcelColumnName
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Get-ExcelColumnName [[-ColumnNumber] <Object>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ColumnNumber
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: True (ByValue)
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-HtmlTable
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Get-HtmlTable [-Url] <Object> [[-TableIndex] <Object>] [[-Header] <Object>] [[-FirstDataRow] <Int32>]
|
||||
[-UseDefaultCredentials] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FirstDataRow
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Header
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UseDefaultCredentials
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TableIndex
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Url
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-Range
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Get-Range [[-Start] <Object>] [[-Stop] <Object>] [[-Step] <Object>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -start
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Step
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -stop
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Get-XYRange
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Get-XYRange [[-TargetData] <Object>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -TargetData
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Import-Html
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Import-Html [[-Url] <Object>] [[-Index] <Object>] [[-Header] <Object>] [[-FirstDataRow] <Int32>]
|
||||
[-UseDefaultCredentials] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -FirstDataRow
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Header
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UseDefaultCredentials
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Index
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Url
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Import-UPS
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Import-UPS [[-TrackingNumber] <Object>] [-UseDefaultCredentials]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -TrackingNumber
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UseDefaultCredentials
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Import-USPS
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Import-USPS [[-TrackingNumber] <Object>] [-UseDefaultCredentials]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -TrackingNumber
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UseDefaultCredentials
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: 'https://github.com/dfinke/ImportExcel'
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Invoke-Sum
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Invoke-Sum [[-Data] <Object>] [[-Dimension] <Object>] [[-Measure] <Object>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Data
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Dimension
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Measure
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,535 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: null
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-ExcelStyle
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
New-ExcelStyle [[-Range] <Object>] [[-NumberFormat] <Object>] [[-BorderAround] <ExcelBorderStyle>]
|
||||
[[-BorderColor] <Object>] [[-BorderBottom] <ExcelBorderStyle>] [[-BorderTop] <ExcelBorderStyle>]
|
||||
[[-BorderLeft] <ExcelBorderStyle>] [[-BorderRight] <ExcelBorderStyle>] [[-FontColor] <Object>]
|
||||
[[-Value] <Object>] [[-Formula] <Object>] [-ArrayFormula] [-ResetFont] [-Bold] [-Italic] [-Underline]
|
||||
[[-UnderLineType] <ExcelUnderLineType>] [-StrikeThru] [[-FontShift] <ExcelVerticalAlignmentFont>]
|
||||
[[-FontName] <String>] [[-FontSize] <Single>] [[-BackgroundColor] <Object>]
|
||||
[[-BackgroundPattern] <ExcelFillStyle>] [[-PatternColor] <Object>] [-WrapText]
|
||||
[[-HorizontalAlignment] <ExcelHorizontalAlignment>] [[-VerticalAlignment] <ExcelVerticalAlignment>]
|
||||
[[-TextRotation] <Int32>] [-AutoSize] [[-Width] <Single>] [[-Height] <Single>] [-Hidden] [-Locked] [-Merge]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -ArrayFormula
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AutoSize
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases: AutoFit
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BackgroundColor
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 15
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BackgroundPattern
|
||||
|
||||
```yaml
|
||||
Type: ExcelFillStyle
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Solid, DarkGray, MediumGray, LightGray, Gray125, Gray0625, DarkVertical, DarkHorizontal, DarkDown, DarkUp, DarkGrid, DarkTrellis, LightVertical, LightHorizontal, LightDown, LightUp, LightGrid, LightTrellis
|
||||
|
||||
Required: False
|
||||
Position: 16
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Bold
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BorderAround
|
||||
|
||||
```yaml
|
||||
Type: ExcelBorderStyle
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Hair, Dotted, DashDot, Thin, DashDotDot, Dashed, MediumDashDotDot, MediumDashed, MediumDashDot, Thick, Medium, Double
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BorderBottom
|
||||
|
||||
```yaml
|
||||
Type: ExcelBorderStyle
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Hair, Dotted, DashDot, Thin, DashDotDot, Dashed, MediumDashDotDot, MediumDashed, MediumDashDot, Thick, Medium, Double
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BorderColor
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BorderLeft
|
||||
|
||||
```yaml
|
||||
Type: ExcelBorderStyle
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Hair, Dotted, DashDot, Thin, DashDotDot, Dashed, MediumDashDotDot, MediumDashed, MediumDashDot, Thick, Medium, Double
|
||||
|
||||
Required: False
|
||||
Position: 6
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BorderRight
|
||||
|
||||
```yaml
|
||||
Type: ExcelBorderStyle
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Hair, Dotted, DashDot, Thin, DashDotDot, Dashed, MediumDashDotDot, MediumDashed, MediumDashDot, Thick, Medium, Double
|
||||
|
||||
Required: False
|
||||
Position: 7
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BorderTop
|
||||
|
||||
```yaml
|
||||
Type: ExcelBorderStyle
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Hair, Dotted, DashDot, Thin, DashDotDot, Dashed, MediumDashDotDot, MediumDashed, MediumDashDot, Thick, Medium, Double
|
||||
|
||||
Required: False
|
||||
Position: 5
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FontColor
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases: ForegroundColor
|
||||
|
||||
Required: False
|
||||
Position: 8
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FontName
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 13
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FontShift
|
||||
|
||||
```yaml
|
||||
Type: ExcelVerticalAlignmentFont
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Baseline, Subscript, Superscript
|
||||
|
||||
Required: False
|
||||
Position: 12
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FontSize
|
||||
|
||||
```yaml
|
||||
Type: Single
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 14
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Formula
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 10
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Height
|
||||
|
||||
```yaml
|
||||
Type: Single
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 22
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Hidden
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -HorizontalAlignment
|
||||
|
||||
```yaml
|
||||
Type: ExcelHorizontalAlignment
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: General, Left, Center, CenterContinuous, Right, Fill, Distributed, Justify
|
||||
|
||||
Required: False
|
||||
Position: 18
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Italic
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Locked
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Merge
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -NumberFormat
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases: NFormat
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -PatternColor
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases: PatternColour
|
||||
|
||||
Required: False
|
||||
Position: 17
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Range
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases: Address
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ResetFont
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -StrikeThru
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -TextRotation
|
||||
|
||||
```yaml
|
||||
Type: Int32
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 20
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UnderLineType
|
||||
|
||||
```yaml
|
||||
Type: ExcelUnderLineType
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Single, Double, SingleAccounting, DoubleAccounting
|
||||
|
||||
Required: False
|
||||
Position: 11
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Underline
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Value
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 9
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -VerticalAlignment
|
||||
|
||||
```yaml
|
||||
Type: ExcelVerticalAlignment
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: Top, Center, Bottom, Distributed, Justify
|
||||
|
||||
Required: False
|
||||
Position: 19
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Width
|
||||
|
||||
```yaml
|
||||
Type: Single
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 21
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -WrapText
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: null
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-Plot
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
New-Plot
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: null
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# New-PSItem
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
New-PSItem
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: null
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-CellStyle
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Set-CellStyle [[-Worksheet] <Object>] [[-Row] <Object>] [[-LastColumn] <Object>] [[-Pattern] <ExcelFillStyle>]
|
||||
[[-Color] <Object>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -Color
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 4
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -LastColumn
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Pattern
|
||||
|
||||
```yaml
|
||||
Type: ExcelFillStyle
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: None, Solid, DarkGray, MediumGray, LightGray, Gray125, Gray0625, DarkVertical, DarkHorizontal, DarkDown, DarkUp, DarkGrid, DarkTrellis, LightVertical, LightHorizontal, LightDown, LightUp, LightGrid, LightTrellis
|
||||
|
||||
Required: False
|
||||
Position: 3
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Row
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Worksheet
|
||||
|
||||
```yaml
|
||||
Type: Object
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,329 +0,0 @@
|
||||
---
|
||||
external help file: ImportExcel-help.xml
|
||||
Module Name: ImportExcel
|
||||
online version: null
|
||||
schema: 2.0.0
|
||||
---
|
||||
|
||||
# Set-WorksheetProtection
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
## SYNTAX
|
||||
|
||||
```text
|
||||
Set-WorksheetProtection [-Worksheet] <ExcelWorksheet> [-IsProtected] [-AllowAll] [-BlockSelectLockedCells]
|
||||
[-BlockSelectUnlockedCells] [-AllowFormatCells] [-AllowFormatColumns] [-AllowFormatRows] [-AllowInsertColumns]
|
||||
[-AllowInsertRows] [-AllowInsertHyperlinks] [-AllowDeleteColumns] [-AllowDeleteRows] [-AllowSort]
|
||||
[-AllowAutoFilter] [-AllowPivotTables] [-BlockEditObject] [-BlockEditScenarios] [[-LockAddress] <String>]
|
||||
[[-UnLockAddress] <String>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
|
||||
```text
|
||||
PS C:\> {{ Add example code here }}
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -AllowAll
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowAutoFilter
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowDeleteColumns
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowDeleteRows
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowFormatCells
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowFormatColumns
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowFormatRows
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowInsertColumns
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowInsertHyperlinks
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowInsertRows
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowPivotTables
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -AllowSort
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BlockEditObject
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BlockEditScenarios
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BlockSelectLockedCells
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -BlockSelectUnlockedCells
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -IsProtected
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -LockAddress
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 1
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -UnLockAddress
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: 2
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Worksheet
|
||||
|
||||
```yaml
|
||||
Type: ExcelWorksheet
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: True
|
||||
Position: 0
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
Reference in New Issue
Block a user