@@ -45,11 +45,11 @@ function Handler {
45
45
[FunctionContext]$fnContext,
46
46
[Parameter(Mandatory=$true)]
47
47
[FunctionResponse]$fnResponse
48
- )
48
+ )
49
49
50
- $output = "Hello! Your input was: " + $fnContext.Body
50
+ $output = "Hello! Your input was: " + $fnContext.Body
51
51
52
- $fnResponse.Body = $output
52
+ $fnResponse.Body = $output
53
53
54
54
}
55
55
```
@@ -63,21 +63,21 @@ function Handler {
63
63
[FunctionContext]$fnContext,
64
64
[Parameter(Mandatory=$true)]
65
65
[FunctionResponse]$fnResponse
66
- )
66
+ )
67
67
68
- $json = $fnContext.Body | Out-String | ConvertFrom-Json
68
+ $json = $fnContext.Body | Out-String | ConvertFrom-Json
69
69
70
- $key1 = $json.key1
71
- $key2 = $json.key2
70
+ $key1 = $json.key1
71
+ $key2 = $json.key2
72
72
73
- $output = @{
74
- "Your JSON input was" = @{
75
- key1=$key1;
76
- key2=$key2;
77
- }
78
- } | ConvertTo-Json -Compress
73
+ $output = @{
74
+ "Your JSON input was" = @{
75
+ key1=$key1;
76
+ key2=$key2;
77
+ }
78
+ } | ConvertTo-Json -Compress
79
79
80
- $fnResponse.Body = $output
80
+ $fnResponse.Body = $output
81
81
82
82
}
83
83
```
@@ -92,19 +92,19 @@ function Handler {
92
92
[FunctionContext]$fnContext,
93
93
[Parameter(Mandatory=$true)]
94
94
[FunctionResponse]$fnResponse
95
- )
95
+ )
96
96
97
- $username = $env:USERNAME
98
- $password = Get-Content "/var/openfaas/secrets/password" | ConvertTo-SecureString -AsPlainText -Force
99
- $cred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)
97
+ $username = $env:USERNAME
98
+ $password = Get-Content "/var/openfaas/secrets/password" | ConvertTo-SecureString -AsPlainText -Force
99
+ $cred = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password)
100
100
101
- $sessionoptions = New-PSSessionOption -SkipCACheck -SkipCNCheck
102
- $output = Invoke-Command -ComputerName <winrm-server> -Authentication Negotiate -SessionOption $sessionoptions -Credential $cred -ScriptBlock {
103
- Import-module ActiveDirectory
104
- Get-Domain
105
- }
101
+ $sessionoptions = New-PSSessionOption -SkipCACheck -SkipCNCheck
102
+ $output = Invoke-Command -ComputerName <winrm-server> -Authentication Negotiate -SessionOption $sessionoptions -Credential $cred -ScriptBlock {
103
+ Import-module ActiveDirectory
104
+ Get-Domain
105
+ }
106
106
107
- $fnResponse.Body = $output
107
+ $fnResponse.Body = $output
108
108
109
109
}
110
110
```
0 commit comments