diff --git a/samples/client/echo_api/powershell/Build.ps1 b/samples/client/echo_api/powershell/Build.ps1 index 49d6a3a9274..f1d1898660c 100644 --- a/samples/client/echo_api/powershell/Build.ps1 +++ b/samples/client/echo_api/powershell/Build.ps1 @@ -46,7 +46,9 @@ function Get-FunctionsToExport { } $ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path -$FunctionPath = 'Api', 'Model', 'Client' | ForEach-Object {Join-Path "$ScriptDir\src\PSOpenAPITools\" $_} +$FunctionPath = 'Api', 'Model', 'Client' | Where-Object { + Join-Path "$ScriptDir\src\PSOpenAPITools\" $_ | Test-Path +} | ForEach-Object { Join-Path "$ScriptDir\src\PSOpenAPITools\" $_ } $Manifest = @{ Path = "$ScriptDir\src\PSOpenAPITools\PSOpenAPITools.psd1" diff --git a/samples/client/echo_api/powershell/src/PSOpenAPITools/PSOpenAPITools.psm1 b/samples/client/echo_api/powershell/src/PSOpenAPITools/PSOpenAPITools.psm1 index daf04503ba9..5b32c2c0133 100644 --- a/samples/client/echo_api/powershell/src/PSOpenAPITools/PSOpenAPITools.psm1 +++ b/samples/client/echo_api/powershell/src/PSOpenAPITools/PSOpenAPITools.psm1 @@ -24,7 +24,9 @@ $Script:Configuration = [System.Collections.HashTable]@{} $Script:CmdletBindingParameters = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable') -'Api', 'Model', 'Client', 'Private' | Get-ChildItem -Path { +'Api', 'Model', 'Client', 'Private' | Where-Object { + Join-Path $PSScriptRoot $_ | Test-Path +} | Get-ChildItem -Path { Join-Path $PSScriptRoot $_ } -Filter '*.ps1' | ForEach-Object { Write-Debug "Importing file: $($_.BaseName)"