Move help from Comment-based to md. Relocate functions (sans help)

This commit is contained in:
jhoneill
2019-11-17 15:30:15 +00:00
parent 07b36e5e56
commit 6d97018de6
133 changed files with 41075 additions and 5241 deletions

95
InferData/InferData.ps1 Normal file
View File

@@ -0,0 +1,95 @@
function Test-String{
param($p)
[PSCustomObject]@{
Test=$p -is [string]
DataType = "string"
}
}
function Test-Date {
param($p)
[datetime]$result = [datetime]::MinValue
[PSCustomObject]@{
Test=[datetime]::TryParse($p, [ref]$result)
DataType = "datetime"
}
}
function Test-Boolean {
param($p)
#[bool]$result = [bool]::FalseString
[bool]$result = $false
[PSCustomObject]@{
Test=[bool]::TryParse($p, [ref]$result)
DataType = "bool"
}
}
function Test-Number {
param($p)
[double]$result = [double]::MinValue
[PSCustomObject]@{
Test=[double]::TryParse($p, [ref]$result)
DataType = "double"
}
}
function Test-Integer {
param($p)
[int]$result = [int]::MinValue
[PSCustomObject]@{
Test=[int]::TryParse($p, [ref]$result)
DataType = "int"
}
}
$tests = [ordered]@{
TestBoolean = Get-Command Test-Boolean
TestInteger = Get-Command Test-Integer
TestNumber = Get-Command Test-Number
TestDate = Get-Command Test-Date
TestString = Get-Command Test-String
}
function Invoke-AllTests {
param(
$target,
[Switch]$OnlyPassing,
[Switch]$FirstOne
)
$resultCount=0
$tests.GetEnumerator() | ForEach-Object {
$result=& $_.Value $target
$testResult = [PSCustomObject]@{
Test = $_.Key
Target = $target
Result = $result.Test
DataType= $result.DataType
}
if(!$OnlyPassing) {
$testResult
} elseif ($result.Test -eq $true) {
if($FirstOne) {
if($resultCount -ne 1) {
$testResult
$resultCount+=1
}
} else {
$testResult
}
}
}
}

View File

@@ -0,0 +1,87 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
schema: 2.0.0
---
# Invoke-AllTests
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
Invoke-AllTests [[-target] <Object>] [-OnlyPassing] [-FirstOne]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -FirstOne
{{ Fill FirstOne Description }}
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -OnlyPassing
{{ Fill OnlyPassing Description }}
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -target
{{ Fill target Description }}
```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

57
InferData/Test-Boolean.md Normal file
View File

@@ -0,0 +1,57 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
schema: 2.0.0
---
# Test-Boolean
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
Test-Boolean [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```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

57
InferData/Test-Date.md Normal file
View File

@@ -0,0 +1,57 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
schema: 2.0.0
---
# Test-Date
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
Test-Date [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```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

57
InferData/Test-Integer.md Normal file
View File

@@ -0,0 +1,57 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
schema: 2.0.0
---
# Test-Integer
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
Test-Integer [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```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

57
InferData/Test-Number.md Normal file
View File

@@ -0,0 +1,57 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
schema: 2.0.0
---
# Test-Number
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
Test-Number [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```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

57
InferData/Test-String.md Normal file
View File

@@ -0,0 +1,57 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
schema: 2.0.0
---
# Test-String
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
Test-String [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```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