@@ -28,25 +28,29 @@ $commands = Get-ChildItem -Path "$($buildFolder.FullName)/modules/þnameþ/Funct
2828Update-ModuleManifest - Path " $ ( $buildFolder.FullName ) /modules/þnameþ/þnameþ.psd1" - FunctionsToExport $commands
2929
3030# Generate Http Trigger
31- $httpCode = Get-Content - Path " $PSScriptRoot \functionHttp\run.ps1" | Join-String " `n "
32- $httpConfig = Get-Content - Path " $PSScriptRoot \functionHttp\function.json" | Join-String " `n "
31+ $httpCode = Get-Content - Path " $PSScriptRoot \functionHttp\run.ps1" | Join-String - Separator " `n "
32+ $httpConfig = Get-Content - Path " $PSScriptRoot \functionHttp\function.json" | Join-String - Separator " `n "
3333foreach ($command in Get-ChildItem - Path " $workingDirectory \þnameþ\functions\httpTrigger" - Recurse - File - Filter * .ps1) {
3434 $authLevel = $config.HttpTrigger.AuthLevel
35- if ($config.HttpTrigger.AuthLevelOverride .$ ($command.BaseName )) {
36- $authLevel = $config.HttpTrigger.AuthLevelOverride .$ ($command.BaseName )
35+ if ($config.HttpTrigger.AuthLevelOverrides .$ ($command.BaseName )) {
36+ $authLevel = $config.HttpTrigger.AuthLevelOverrides .$ ($command.BaseName )
37+ }
38+ $methods = $config.HttpTrigger.Methods
39+ if ($config.HttpTrigger.MethodOverrides .$ ($command.BaseName )) {
40+ $methods = $config.HttpTrigger.MethodOverrides .$ ($command.BaseName )
3741 }
3842 $endpointFolder = New-Item - Path $buildFolder.FullName - Name $command.BaseName - ItemType Directory
3943 $httpCode -replace ' %COMMAND%' , $command.BaseName | Set-Content - Path " $ ( $endpointFolder.FullName ) \run.ps1"
40- $httpConfig -replace ' %AUTHLEVEL%' , $authLevel | Set-Content - Path " $ ( $endpointFolder.FullName ) \function.json"
44+ $httpConfig -replace ' %AUTHLEVEL%' , $authLevel -replace ' %METHODS% ' , ( $methods -join ' ", " ' ) | Set-Content - Path " $ ( $endpointFolder.FullName ) \function.json"
4145}
4246
4347# Generate Timer Trigger
44- $timerCode = Get-Content - Path " $PSScriptRoot \functionTimer\run.ps1" | Join-String " `n "
45- $timerConfig = Get-Content - Path " $PSScriptRoot \functionTimer\function.json" | Join-String " `n "
48+ $timerCode = Get-Content - Path " $PSScriptRoot \functionTimer\run.ps1" | Join-String - Separator " `n "
49+ $timerConfig = Get-Content - Path " $PSScriptRoot \functionTimer\function.json" | Join-String - Separator " `n "
4650foreach ($command in Get-ChildItem - Path " $workingDirectory \þnameþ\functions\timerTrigger" - Recurse - File - Filter * .ps1) {
4751 $schedule = $config.TimerTrigger.Schedule
48- if ($config.TimerTrigger.ScheduleOverride .$ ($command.BaseName )) {
49- $schedule = $config.TimerTrigger.ScheduleOverride .$ ($command.BaseName )
52+ if ($config.TimerTrigger.ScheduleOverrides .$ ($command.BaseName )) {
53+ $schedule = $config.TimerTrigger.ScheduleOverrides .$ ($command.BaseName )
5054 }
5155 $endpointFolder = New-Item - Path $buildFolder.FullName - Name $command.BaseName - ItemType Directory
5256 $timerCode -replace ' %COMMAND%' , $command.BaseName | Set-Content - Path " $ ( $endpointFolder.FullName ) \run.ps1"
0 commit comments