You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm tested v2.6.2 missing capabilities to import-module ps1 file. It's working fine in v2.4.2 and 2.5.2. My code as per below :
Import-Module -Name Pode -RequiredVersion 2.6.2
get-module Pode | Out-Default
#1) not working
#Import-Module "D:\Scripts\testModule.ps1" -Scope Global
#2) not working in 2.6.2, work well in 2.4.2 and 2.5.2
Import-Module "D:\Scripts\testModule.ps1"
Start-PodeServer -Threads 2{
Add-PodeEndpoint -Address * -Port 8200 -Protocol Http
Add-PodeRoute -Method Get -Path 'api' -ScriptBlock {
#3) not working
#Import-Module "D:\Scripts\testModule.ps1"
("Inside ThreadId: {0}" -f $ThreadId) | Out-Default
$test = randomTaskID
Write-PodeJsonResponse -Value @{ 'value' = "$test" }
}
New-PodeLoggingMethod -Terminal | Enable-PodeErrorLogging
}
Specifies the names of the modules to import. Enter the name of the module or the name of a file in the module, such as a .psd1, .psm1, .dll, or .ps1 file. File paths are optional. Wildcard characters aren't permitted. You can also pipe module names and filenames to Import-Module.
Since it used to work pre-2.6.0, and the docs say it should work for ps1 files then yes, it's a bug. Though it seems there's a workaround for now if changing the extension to psm1 works.
Hi,
I'm tested v2.6.2 missing capabilities to import-module ps1 file. It's working fine in v2.4.2 and 2.5.2. My code as per below :
testModule.ps1 contain code as per below :
Consider bug or expected behavior for latest release?
By the way, it's working well if i paste the function before Start-PodeServer.
Thanks.
The text was updated successfully, but these errors were encountered: