mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
Add powershell echo test, rename api key names (#17043)
* add powershell echo test, rename api key names * update
This commit is contained in:
73
samples/client/echo_api/powershell/Build.ps1
Normal file
73
samples/client/echo_api/powershell/Build.ps1
Normal file
@@ -0,0 +1,73 @@
|
||||
#
|
||||
# Echo Server API
|
||||
# Echo Server API
|
||||
# Version: 0.1.0
|
||||
# Contact: team@openapitools.org
|
||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||
#
|
||||
|
||||
function Get-FunctionsToExport {
|
||||
[CmdletBinding()]
|
||||
Param (
|
||||
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[Alias('FullName')]
|
||||
$Path
|
||||
)
|
||||
|
||||
Process {
|
||||
$Token = $null
|
||||
$ParserErr = $null
|
||||
|
||||
$Ast = [System.Management.Automation.Language.Parser]::ParseFile(
|
||||
$Path,
|
||||
[ref]$Token,
|
||||
[ref]$ParserErr
|
||||
)
|
||||
|
||||
if ($ParserErr) {
|
||||
throw $ParserErr
|
||||
} else {
|
||||
foreach ($name in 'Begin', 'Process', 'End') {
|
||||
foreach ($Statement in $Ast."${name}Block".Statements) {
|
||||
if (
|
||||
[String]::IsNullOrWhiteSpace($Statement.Name) -or
|
||||
$Statement.Extent.ToString() -notmatch
|
||||
('function\W+{0}' -f $Statement.Name)
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
$Statement.Name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
|
||||
$FunctionPath = 'Api', 'Model', 'Client' | ForEach-Object {Join-Path "$ScriptDir\src\PSOpenAPITools\" $_}
|
||||
|
||||
$Manifest = @{
|
||||
Path = "$ScriptDir\src\PSOpenAPITools\PSOpenAPITools.psd1"
|
||||
|
||||
Author = 'OpenAPI Generator Team'
|
||||
CompanyName = 'openapitools.org'
|
||||
Description = 'PSOpenAPITools - the PowerShell module for Echo Server API'
|
||||
|
||||
ModuleVersion = '0.1.2'
|
||||
|
||||
RootModule = 'PSOpenAPITools.psm1'
|
||||
Guid = 'a27b908d-2a20-467f-bc32-af6f3a654ac5' # Has to be static, otherwise each new build will be considered different module
|
||||
|
||||
PowerShellVersion = '6.2'
|
||||
|
||||
FunctionsToExport = $FunctionPath | Get-ChildItem -Filter *.ps1 | Get-FunctionsToExport
|
||||
|
||||
VariablesToExport = @()
|
||||
AliasesToExport = @()
|
||||
CmdletsToExport = @()
|
||||
|
||||
}
|
||||
|
||||
New-ModuleManifest @Manifest
|
||||
Reference in New Issue
Block a user