Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Add ConvertFrom-TextTable cmdlet #33

Merged
merged 2 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ out/
*.nupkg
project.lock.json
.DS_Store

Microsoft.PowerShell.TextUtility.xml
# VSCode directories that are not at the repository root
/**/.vscode/
26 changes: 26 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ param (
[switch]
$signed,

[Parameter(ParameterSetName="package")]
[Parameter(ParameterSetName="test")]
[switch]
$test,
Expand All @@ -43,6 +44,7 @@ $moduleFileManifest = @(

$moduleName = "Microsoft.PowerShell.TextUtility"
$repoRoot = git rev-parse --show-toplevel
$testRoot = "${repoRoot}/test"

#
function Get-ModuleInfo {
Expand Down Expand Up @@ -90,6 +92,25 @@ function Export-Module
}
}

function Test-Module {
try {
$PSVersionTable | Out-String -Stream | Write-Verbose -Verbose
$pesterInstallations = Get-Module -ListAvailable -Name Pester
if ($pesterInstallations.Version -notcontains "4.10.1") {
Install-Module -Name Pester -RequiredVersion 4.10.1 -Force -Scope CurrentUser
}
$importTarget = "Import-Module ${PSScriptRoot}/out/${ModuleName}"
$importPester = "Import-Module Pester -Max 4.10.1"
$invokePester = "Invoke-Pester -OutputFormat NUnitXml -EnableExit -OutputFile ../Microsoft.PowerShell.TextUtility.xml"
$command = "${importTarget}; ${importPester}; ${invokePester}"
Push-Location $testRoot
pwsh -noprofile -command $command
}
finally {
Pop-Location
}
}

try {
Push-Location "$PSScriptRoot/src/code"
$script:moduleInfo = Get-ModuleInfo
Expand All @@ -112,6 +133,9 @@ try {
}

if ($Test) {
Test-Module

<#
$script = [ScriptBlock]::Create("try {
Import-Module '${repoRoot}/out/${moduleName}/'
Import-Module -Name Pester -Max 4.99
Expand All @@ -122,6 +146,8 @@ try {
Pop-Location
}")
pwsh -c $script
#>
return
}

if ($Package) {
Expand Down
7 changes: 3 additions & 4 deletions src/Microsoft.PowerShell.TextUtility.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@{
RootModule = '.\Microsoft.PowerShell.TextUtility.dll'
ModuleVersion = '0.1.0'
ModuleVersion = '0.5.0'
CompatiblePSEditions = @('Desktop', 'Core')
GUID = '5cb64356-cd04-4a18-90a4-fa4072126155'
Author = 'Microsoft Corporation'
Expand All @@ -13,14 +13,13 @@
PowerShellVersion = '5.1'
FormatsToProcess = @('Microsoft.PowerShell.TextUtility.format.ps1xml')
CmdletsToExport = @(
'Compare-Text','ConvertFrom-Base64','ConvertTo-Base64'
'Compare-Text','ConvertFrom-Base64','ConvertTo-Base64',"ConvertFrom-TextTable"
)
PrivateData = @{
PSData = @{
LicenseUri = 'https://github.com/PowerShell/TextUtility/blob/main/LICENSE'
ProjectUri = 'https://github.com/PowerShell/TextUtility'
ReleaseNotes = 'Initial release'
Prerelease = 'Preview1'
ReleaseNotes = 'Second pre-release'
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/code/Microsoft.PowerShell.TextUtility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0-*">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="6.0.6" >
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Loading